public function Lexer::peek

Moves the lookahead token forward.

Return value

array | null The next token or NULL if there are no more tokens ahead.

1 call to Lexer::peek()
Lexer::glimpse in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
Peeks at the next token, returns it and immediately resets the peek.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php, line 174

Class

Lexer
Base class for writing simple lexers, i.e. for creating small DSLs.

Namespace

Doctrine\Common

Code

public function peek() {
  if (isset($this->tokens[$this->position + $this->peek])) {
    return $this->tokens[$this->position + $this->peek++];
  }
  else {
    return null;
  }
}