diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-19 16:08:25 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-19 16:08:25 +1000 |
| commit | 9c48084f3b5064d580a5c88a6fe9170599cf8879 (patch) | |
| tree | cfee62fb06abbd182568efa0395be2077a021fca /inc/lib/Twig/Node/Module.php | |
| parent | 01857d176a2a9a2e3816b9cbf32da0c58f6aac3d (diff) | |
upgrade twig library
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") ; } |
