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

Breadcrumb

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

function Scanner::getPosition

Returns current scanner state

Parameters

bool $scanPosition By default this method returns the scanner: consumed position, if this parameter is true the scanned position will be returned

Return value

Position

5 calls to Scanner::getPosition()
Scanner::error in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Throws a syntax error
Scanner::getToken in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Returns the current token
Scanner::reconsumeCurrentTokenAsRegexp in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Tries to reconsume the current token as a regexp if possible
Scanner::scanPunctuator in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Punctuator scanning method
Scanner::skipWhitespacesAndComments in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Skips whitespaces and comments from the current scan position. If comments handling is enabled, the array of parsed comments

File

vendor/mck89/peast/lib/Peast/Syntax/Scanner.php, line 601

Class

Scanner
Base class for scanners.

Namespace

Peast\Syntax

Code

public function getPosition($scanPosition = false) {
    if ($scanPosition) {
        return new Position($this->line, $this->column, $this->index);
    }
    else {
        return $this->position;
    }
}

API Navigation

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