// embedded templates are set as attributes so that they are only visited once by the visitors
parent::__construct($nodes, [ 'index' => null, 'embedded_templates' => $embeddedTemplates, ], 1);
// populate the template name of all node children
$this->setSourceContext($source); }
/**
* Compiles a template source code.
*
* @throws SyntaxError When there was an error during tokenizing, parsing or compiling
*/ publicfunctioncompileSource(Source $source): string { try{ return$this->compile($this->parse($this->tokenize($source))); }catch(Error $e){ $e->setSourceContext($source); throw$e; }catch(\Exception $e){ thrownewSyntaxError(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e); } }