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

Breadcrumb

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

function Scanner::noLineTerminators

Checks that there are not line terminators following the current scan position before next token

Parameters

bool $nextToken By default it checks the current token position: relative to the current position, if this parameter is true the check will be done relative to the next token

Return value

bool

1 call to Scanner::noLineTerminators()
Scanner::isBefore in vendor/mck89/peast/lib/Peast/Syntax/Scanner.php
Checks if one of the given strings follows the current scan position

File

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

Class

Scanner
Base class for scanners.

Namespace

Peast\Syntax

Code

public function noLineTerminators($nextToken = false) {
    if ($nextToken) {
        $nextToken = $this->getNextToken();
        $refLine = !$nextToken ? null : $nextToken->location->end
            ->getLine();
    }
    else {
        $refLine = $this->getPosition()
            ->getLine();
    }
    $token = $this->currentToken ?: $this->getToken();
    return $token && $token->location->start
        ->getLine() === $refLine;
}

API Navigation

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