public function Twig_TokenStream::next

Sets the pointer to the next token and returns the old one.

Return value

Twig_Token

1 call to Twig_TokenStream::next()

File

drupal/core/vendor/twig/twig/lib/Twig/TokenStream.php, line 58

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', -1, $this->filename);
  }
  return $this->tokens[$this->current - 1];
}