public function Twig_Parser::setMacro in Translation template extractor 7.3
Same name and namespace in other branches
- 6.3 vendor/Twig/Parser.php \Twig_Parser::setMacro()
File
- vendor/
Twig/ Parser.php, line 250
Class
- Twig_Parser
- Default parser implementation.
Code
public function setMacro($name, Twig_Node_Macro $node) {
if ($this
->isReservedMacroName($name)) {
throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node
->getLine(), $this
->getFilename());
}
$this->macros[$name] = $node;
}