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

Breadcrumb

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

function Parser::parseStringLiteral

Parses a string literal

Return value

Node\StringLiteral|null

6 calls to Parser::parseStringLiteral()
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::parseFromClause in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses the from keyword and the following string in import and export declarations
Parser::parseImportDeclaration in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses an import declaration
Parser::parseLiteral in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a literal
Parser::parseModuleExportName in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses an export name

... See full list

File

vendor/mck89/peast/lib/Peast/Syntax/Parser.php, line 3835

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseStringLiteral() {
    $token = $this->scanner
        ->getToken();
    if ($token && $token->type === Token::TYPE_STRING_LITERAL) {
        $val = $token->value;
        $this->checkInvalidEscapeSequences($val);
        $this->scanner
            ->consumeToken();
        $node = $this->createNode("StringLiteral", $token);
        $node->setRaw($val);
        return $this->completeNode($node);
    }
    return null;
}

API Navigation

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