diff options
Diffstat (limited to 'inc/lib/Twig/Node/Module.php')
| -rwxr-xr-x[-rw-r--r--] | inc/lib/Twig/Node/Module.php | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/inc/lib/Twig/Node/Module.php b/inc/lib/Twig/Node/Module.php index 585048b8..224410a2 100644..100755 --- a/inc/lib/Twig/Node/Module.php +++ b/inc/lib/Twig/Node/Module.php @@ -235,9 +235,41 @@ class Twig_Node_Module extends Twig_Node $compiler ->outdent() + ->write(");\n\n") + ; + + // macro information + $compiler + ->write("\$this->macros = array(\n") + ->indent() + ; + + foreach ($this->getNode('macros') as $name => $node) { + $compiler + ->addIndentation()->repr($name)->raw(" => array(\n") + ->indent() + ->write("'method' => ")->repr($node->getAttribute('method'))->raw(",\n") + ->write("'arguments' => array(\n") + ->indent() + ; + foreach ($node->getNode('arguments') as $argument => $value) { + $compiler->addIndentation()->repr($argument)->raw (' => ')->subcompile($value)->raw(",\n"); + } + $compiler + ->outdent() + ->write("),\n") + ->outdent() + ->write("),\n") + ; + } + $compiler + ->outdent() ->write(");\n") + ; + + $compiler ->outdent() - ->write("}\n\n"); + ->write("}\n\n") ; } |
