projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
d72b6ad
)
added the possibility to look at more than just the very next token
author
Fabien Potencier
<fabien.potencier@gmail.com>
Wed, 22 Dec 2010 10:58:10 +0000 (11:58 +0100)
committer
Fabien Potencier
<fabien.potencier@gmail.com>
Wed, 22 Dec 2010 10:58:10 +0000 (11:58 +0100)
lib/Twig/TokenStream.php
patch
|
blob
|
history
diff --git
a/lib/Twig/TokenStream.php
b/lib/Twig/TokenStream.php
index
0a7ef90
..
187c00c
100644
(file)
--- a/
lib/Twig/TokenStream.php
+++ b/
lib/Twig/TokenStream.php
@@
-69,15
+69,17
@@
class Twig_TokenStream
/**
* Looks at the next token.
*
+ * @param integer $number
+ *
* @return Twig_Token
*/
- public function look()
+ public function look($number = 1)
{
- if (!isset($this->tokens[$this->current + 1])) {
+ if (!isset($this->tokens[$this->current + $number])) {
throw new Twig_Error_Syntax('Unexpected end of template');
}
- return $this->tokens[$this->current + 1];
+ return $this->tokens[$this->current + $number];
}
/**