summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/Node/Module.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-11-11 21:54:35 +0100
committerczaks <marcin@6irc.net>2013-11-11 21:54:35 +0100
commitf5657caf24753ed7c25d56659ae8dfe79d48b99a (patch)
tree989f1149070194f18f6250c851159dda813151fe /inc/lib/Twig/Node/Module.php
parent0a58973631626879abeea4956b33cc2b56dea453 (diff)
parent9fb63b053fbb552a2a8bbde1e230a8b73296fb6d (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard into vichan-devel-4.5
Conflicts: inc/config.php install.php post.php stylesheets/style.css
Diffstat (limited to 'inc/lib/Twig/Node/Module.php')
-rw-r--r--inc/lib/Twig/Node/Module.php34
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
--- 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")
;
}