Add comments

This commit is contained in:
Jordi Boggiano
2012-01-24 18:53:53 +01:00
parent 0255764455
commit 0d656f53af
+2
View File
@@ -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;
}