upgrade twig library

This commit is contained in:
Michael Foster 2013-09-19 16:08:25 +10:00
parent 01857d176a
commit 9c48084f3b
163 changed files with 275 additions and 94 deletions

36
inc/lib/Twig/Node/Module.php Normal file → Executable file
View file

@ -235,9 +235,41 @@ class Twig_Node_Module extends Twig_Node
$compiler
->outdent()
->write(");\n")
->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\n");
->write(");\n")
;
$compiler
->outdent()
->write("}\n\n")
;
}