public function Twig_TokenStream::next in Translation template extractor 6.3
Same name and namespace in other branches
- 7.3 vendor/Twig/TokenStream.php \Twig_TokenStream::next()
- 7.2 vendor/Twig/TokenStream.php \Twig_TokenStream::next()
Sets the pointer to the next token and returns the old one.
Return value
2 calls to Twig_TokenStream::next()
- Twig_TokenStream::expect in vendor/
Twig/ TokenStream.php - Tests a token and returns it or throws a syntax error.
- Twig_TokenStream::nextIf in vendor/
Twig/ TokenStream.php - Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
File
- vendor/
Twig/ TokenStream.php, line 57
Class
- Twig_TokenStream
- Represents a token stream.
Code
public function next() {
if (!isset($this->tokens[++$this->current])) {
throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current - 1]
->getLine(), $this->filename);
}
return $this->tokens[$this->current - 1];
}