projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
0255764
)
Add comments
author
Jordi Boggiano
<j.boggiano@seld.be>
Tue, 24 Jan 2012 17:53:53 +0000 (18:53 +0100)
committer
Jordi Boggiano
<j.boggiano@seld.be>
Tue, 24 Jan 2012 17:53:53 +0000 (18:53 +0100)
lib/Twig/Parser.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Parser.php
b/lib/Twig/Parser.php
index
15325da
..
4b85259
100644
(file)
--- a/
lib/Twig/Parser.php
+++ b/
lib/Twig/Parser.php
@@
-62,6
+62,7
@@
class Twig_Parser implements Twig_ParserInterface
*/
public function parse(Twig_TokenStream $stream)
{
+ // push all variables into the stack to keep the current state of the parser
$vars = get_object_vars($this);
unset($vars['stack'], $vars['env']);
$this->stack[] = $vars;
@@
-109,6
+110,7
@@
class Twig_Parser implements Twig_ParserInterface
$node = $traverser->traverse($node);
+ // restore previous stack so previous parse() call can resume working
foreach (array_pop($this->stack) as $key => $val) {
$this->$key = $val;
}