/*!
\static
\return true if template compilation should include comments.
498500
static function isNodePlacementEnabled()
    {
        if ( isset( $GLOBALS['eZTemplateCompilerSettings']['nodeplacement'] ) and
             $GLOBALS['eZTemplateCompilerSettings']['nodeplacement'] !== null )
        {
            return $GLOBALS['eZTemplateCompilerSettings']['nodeplacement'];
        }

        $ini = eZINI::instance();
        $nodePlacementEnabled = $ini->variable( 'TemplateSettings', 'CompileNodePlacements' ) == 'enabled';
        return $nodePlacementEnabled;
    }
884532
function commentNode(outNode, options) {
	const node = outNode.node;

	if (!options.enabled || !options.trigger || !node.name) {
		return;
	}

	const attrs = outNode.node.attributes.reduce((out, attr) => {
		if (attr.name && attr.value != null) {
			out[attr.name.toUpperCase().replace(/-/g, '_')] = attr.value;
		}

		return out;
	}, {});

	// add comment only if attribute trigger is present
	for (let i = 0, il = options.trigger.length; i < il; i++) {
		if (options.trigger[i].toUpperCase() in attrs) {
			outNode.open = template(options.before, attrs) + outNode.open;
			if (outNode.close) {
				outNode.close += template(options.after, attrs);
			}
			break;
		}
	}
}
1028686
private function isComment($line)
    {
        // if it's an empty line you might as well skip it
        if (empty($line)) return true;

        $is_comment = false;

        foreach ($this->_comment_character_list as $comment_char) {
            $line = trim($line);
            if (strpos($line, $comment_char) !== false && strpos($line, $comment_char) <= 3) {
                $is_comment = true;
                break;
            }
        }

        return $is_comment;
    }
1320765
def paragraph_is_fully_commented(lines, comment, main_language):
    """"""
    for i, line in enumerate(lines):
        if line.startswith(comment):
            if line.startswith((comment + ' %', comment + ' ?', comment + ' !')) and is_magic(line, main_language):
                return False
            continue
        return i > 0 and _BLANK_LINE.match(line)
    return True
1237922
public function checkCommentDescription(bool $descriptionRequired): void
    {
        $this->descriptionRequired = $descriptionRequired;

        $commentStartToken = $this->docHelper->getBlockStartToken();
        $commentEndToken = $this->docHelper->getBlockEndToken();

        $summaryPtr = $this->summaryHelper->getCommentSummaryPosition();

        if ($summaryPtr === -1) {
            return;
        }

        $hasTags = count($commentStartToken['comment_tags']) > 0;

        $descriptionStartPtr = $this->getCommentDescriptionStartPointer();

        if ($descriptionStartPtr === -1) {
            $this->addDescriptionNotFoundError($summaryPtr);

            return;
        }

        $descriptionEndPtr = $this->getCommentDescriptionEndPointer();
        $descEndToken = $this->tokens[$descriptionEndPtr];

        $this->checkCommentDescriptionUcFirst($descriptionStartPtr);

        //Fix no or too much lines after description.
        $toLine = $commentEndToken['line'];
        $expectedLines = 0;

        if ($hasTags) {
            $firstTagPtr = array_shift($commentStartToken['comment_tags']);
            $firstTagToken = $this->tokens[$firstTagPtr];
            $toLine = $firstTagToken['line'];

            $expectedLines = 1;
        }

        $diffLines = $toLine - $descEndToken['line'] - 1;

        if ($diffLines === $expectedLines) {
            return;
        }

        if ($diffLines < $expectedLines && $hasTags) {
            $fixNoLine = $this->file->addFixableError(
                AbstractDocSniff::MESSAGE_NO_LINE_AFTER_DESCRIPTION,
                $descriptionEndPtr,
                AbstractDocSniff::CODE_NO_LINE_AFTER_DESCRIPTION
            );

            if ($fixNoLine) {
                $this->fixNoLineAfterDescription();
            }

            return;
        }

        $fixMuchLines = $this->file->addFixableError(
            AbstractDocSniff::MESSAGE_MUCH_LINES_AFTER_DESCRIPTION,
            $descriptionEndPtr,
            AbstractDocSniff::CODE_MUCH_LINES_AFTER_DESCRIPTION
        );

        if ($fixMuchLines) {
            $this->fixMuchLinesAfterDescription($descEndToken['line'] + 1, $toLine - 1);
        }
    }
1295293
static function hasCompiledTemplate( $key, $timestamp, &$resourceData )
    {
        if ( !eZTemplateCompiler::isCompilationEnabled() )
            return false;
        if ( eZTemplateCompiler::alwaysGenerate() )
            return false;

        $cacheFileName = eZTemplateCompiler::compilationFilename( $key, $resourceData );

        $php = new eZPHPCreator( eZTemplateCompiler::compilationDirectory(), $cacheFileName, eZTemplateCompiler::TemplatePrefix() );
        $canRestore = $php->canRestore( $timestamp );
        $uri = false;
        if ( $canRestore )
            eZDebugSetting::writeDebug( 'eztemplate-compile', "Cache hit for uri '$uri' with key '$key'", 'eZTemplateCompiler::hasCompiledTemplate' );
        else
            eZDebugSetting::writeDebug( 'eztemplate-compile', "Cache miss for uri '$uri' with key '$key'", 'eZTemplateCompiler::hasCompiledTemplate' );
        return $canRestore;
    }
660185
public function comments()
    {
        if (!class_exists(\Modules\Blog\Entities\Comment::class, false)) {
            throw new \Exception('in order to use User::comments() you have to install the \'vain-blog\' module');
        }

        return $this->hasMany(\Modules\Blog\Entities\Comment::class);
    }
122882
public function compile(): void
	{
		// Get teplate contents

		$contents = $this->fileSystem->get($this->template);

		// Compile template

		foreach($this->compileOrder as $method)
		{
			$contents = $this->$method($contents);
		}

		// Store compiled template

		$this->fileSystem->put($this->cachePath . '/' . md5($this->template) . '.php', trim($contents));
	}
1116208
private function isAllowed($template)
    {
        foreach ($this->excludes as $exclude) {
            if (true === $this->match($template, $exclude)) {
                return false;
            }
        }
        foreach ($this->includes as $include) {
            if (true === $this->match($template, $include)) {
                return true;
            }
        }

        return false;
    }
64142
public function addComment($comment)
    {
        if (is_string($comment)) {
            $comment = AnHelperString::trim($comment);

            $comment = array(
                'author' => get_viewer() ,
                'body' => $comment,
                'component' => $this->component,
            );
        }

        $comment = $this->_mixer->comments->addNew($comment);

        if ($this->_mixer->isSubscribable() && !$this->_mixer->subscribed($comment->author)) {
            $this->_mixer->addSubscriber($comment->author);
        }

        return $comment;
    }
124454
protected function AllowToCommentReview()
    {
        if ($this->GetCommentTypeId()) {
            $oModuleConfiguration = $this->GetModuleConfiguration();
            if ($oModuleConfiguration->fieldAllowCommentReviews) {
                return true;
            }
        }

        return false;
    }
715315
public function is_included() {
		$queried_object = get_queried_object();

		if ( ! empty( $queried_object->taxonomy ) && $queried_object->taxonomy == $this->get_subtype() ) {
			return true;
		}

		return false;
	}
783868
function isConsecutiveComment(comment) {
            const previousTokenOrComment = sourceCode.getTokenBefore(comment, { includeComments: true });

            return Boolean(
                previousTokenOrComment &&
                ["Block", "Line"].indexOf(previousTokenOrComment.type) !== -1
            );
        }
66738
protected function processComment()
    {
        $comment=strtr(trim(preg_replace('/^\s*\**( |\t)?/m','',trim($this->getDocComment(),'/'))),"\r",'');
        if(preg_match('/^\s*@\w+/m',$comment, $matches, PREG_OFFSET_CAPTURE)){
            $meta=substr($comment,$matches[0][1]);
            $this->processTags($meta);
        }
    }
469818
static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
    {
        $compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->ext->_inheritance->init(\$_smarty_tpl, " .
            var_export($initChildSequence, true) . ");\n?>\n";
    }
1221515
public function hasDocTypes() {
    $doc_comment = $this->getFunction()->getDocComment();
    if (!$doc_comment) {
      return FALSE;
    }
    $param_tag = $doc_comment->getParameter($this->getName());
    if (!$param_tag) {
      return FALSE;
    }
    $types = $param_tag->getTypes();
    return !empty($types);
  }
1156770
public function getCommentTree($source, $context)
    {
        $key = $this->getSpecificSourceCacheKey(
            $source,
            $context
        );

        return isset($this->commentTree[$key])
            ? $this->commentTree[$key]
            : [];
    }