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()
Twig_TokenStream::expect in drupal/core/vendor/twig/twig/lib/Twig/TokenStream.php
Tests a token and returns it or throws a syntax error.

File

drupal/core/vendor/twig/twig/lib/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];
}