Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractLexer.php

function AbstractLexer::peek

Moves the lookahead token forward.

Return value

Token<T, V>|null The next token or NULL if there are no more tokens ahead.

1 call to AbstractLexer::peek()
AbstractLexer::glimpse in vendor/doctrine/lexer/src/AbstractLexer.php
Peeks at the next token, returns it and immediately resets the peek.

File

vendor/doctrine/lexer/src/AbstractLexer.php, line 220

Class

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

Namespace

Doctrine\Common\Lexer

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal