added the possibility look more than one token in the token stream

git-svn-id: http://svn.twig-project.org/trunk@40 93ef8e89-cb99-4229-a87c-7fa0fa45744b
This commit is contained in:
fabien
2009-10-14 06:39:47 +00:00
parent f601832cf9
commit 84684d9d64
+4 -2
View 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);