mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 02:16:41 +00:00
Add comments
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user