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

Breadcrumb

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

function TokenStream::skipLeft

Parameters

int|string|(int|string)[] $skipTokenType :

File

vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php, line 102

Class

TokenStream
Provides operations on token streams, for use by pretty printer.

Namespace

PhpParser\Internal

Code

public function skipLeft(int $pos, $skipTokenType) : int {
    $tokens = $this->tokens;
    $pos = $this->skipLeftWhitespace($pos);
    if ($skipTokenType === \T_WHITESPACE) {
        return $pos;
    }
    if (!$tokens[$pos]->is($skipTokenType)) {
        // Shouldn't happen. The skip token MUST be there
        throw new \Exception('Encountered unexpected token');
    }
    $pos--;
    return $this->skipLeftWhitespace($pos);
}

API Navigation

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