Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Compiler.php

function Compiler::addDebugInfo

Return value

$this

File

vendor/twig/twig/src/Compiler.php, line 195

Class

Compiler
@author Fabien Potencier <fabien@symfony.com>

Namespace

Twig

Code

public function addDebugInfo(Node $node) {
    if ($node->getTemplateLine() != $this->lastLine) {
        $this->write(\sprintf("// line %d\n", $node->getTemplateLine()));
        $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset);
        $this->sourceOffset = \strlen($this->source);
        $this->debugInfo[$this->sourceLine] = $node->getTemplateLine();
        $this->lastLine = $node->getTemplateLine();
    }
    return $this;
}
RSS feed
Powered by Drupal