added the possibility look more than one token in the token stream
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Wed, 14 Oct 2009 06:39:47 +0000 (06:39 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Wed, 14 Oct 2009 06:39:47 +0000 (06:39 +0000)
git-svn-id: http://svn.twig-project.org/trunk@40 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/TokenStream.php

index 7b255d5..9c63819 100644 (file)
@@ -47,8 +47,10 @@ class Twig_TokenStream
 
   /**
    * Sets the pointer to the next token and returns the old one.
+   *
+   * @param Boolean $fromStack Whether to get a token from the stack or not
    */
-  public function next()
+  public function next($fromStack = true)
   {
     if (!empty($this->pushed))
     {
@@ -91,7 +93,7 @@ class Twig_TokenStream
    */
   public function look()
   {
-    $old = $this->next();
+    $old = $this->next(false);
     $new = $this->current;
     $this->push($old);
     $this->push($new);