type/value a syntax error is thrown. Otherwise, if the type and value are correct,
the token is returned and the stream moves to the next token.
+* ``look()``: Looks a the next token without consuming it.
+
Parsing expressions is done by calling the ``parseExpression()`` like we did for
the ``set`` tag.
}
/**
+ * Looks at the next token.
+ *
+ * @return Twig_Token
+ */
+ public function look()
+ {
+ if (!isset($this->tokens[$this->current + 1])) {
+ throw new Twig_Error_Syntax('Unexpected end of template');
+ }
+
+ return $this->tokens[$this->current + 1];
+ }
+
+ /**
* test() current token
*
* @return bool