芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/midiatech/vendor/twig/twig/src/TokenParser/MacroTokenParser.php
* {% endmacro %} * * @final */ class MacroTokenParser extends AbstractTokenParser { public function parse(Token $token) { $lineno = $token->getLine(); $stream = $this->parser->getStream(); $name = $stream->expect(Token::NAME_TYPE)->getValue(); $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); $stream->expect(Token::BLOCK_END_TYPE); $this->parser->pushLocalScope(); $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); if ($token = $stream->nextIf(Token::NAME_TYPE)) { $value = $token->getValue(); if ($value != $name) { throw new SyntaxError(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); } } $this->parser->popLocalScope(); $stream->expect(Token::BLOCK_END_TYPE); $this->parser->setMacro($name, new MacroNode($name, new BodyNode([$body]), $arguments, $lineno, $this->getTag())); return new Node(); } public function decideBlockEnd(Token $token) { return $token->test('endmacro'); } public function getTag() { return 'macro'; } } class_alias('Twig\TokenParser\MacroTokenParser', 'Twig_TokenParser_Macro');