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

Breadcrumb

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

function ParserAbstract::assertEndOfStatement

Asserts that a valid end of statement follows the current position

Return value

boolean

Throws

Exception

12 calls to ParserAbstract::assertEndOfStatement()
Parser::parseBreakStatement in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a break statement
Parser::parseContinueStatement in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a continue statement
Parser::parseDebuggerStatement in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a debugger statement
Parser::parseDirectivePrologues in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parse directive prologues. The result is an array where the first element is the array of parsed nodes and the second element is the array of directive prologues values
Parser::parseExportDeclaration in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses an export declaration

... See full list

File

vendor/mck89/peast/lib/Peast/Syntax/ParserAbstract.php, line 315

Class

ParserAbstract
Base class for parsers.

Namespace

Peast\Syntax

Code

protected function assertEndOfStatement() {
    
    //The end of statement is reached when it is followed by line
    
    //terminators, end of source, "}" or ";". In the last case the token
    
    //must be consumed
    if (!$this->scanner
        ->noLineTerminators()) {
        return true;
    }
    else {
        if ($this->scanner
            ->consume(";")) {
            return true;
        }
        $token = $this->scanner
            ->getToken();
        if (!$token || $token->value === "}") {
            return true;
        }
    }
    $this->error();
}

API Navigation

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