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

Breadcrumb

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

function Parser::parseRegularExpressionLiteral

Parses a regular expression literal

Return value

Node\Literal|null

1 call to Parser::parseRegularExpressionLiteral()
Parser::parsePrimaryExpression in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a primary expression

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseRegularExpressionLiteral() {
    if ($token = $this->scanner
        ->reconsumeCurrentTokenAsRegexp()) {
        $this->scanner
            ->consumeToken();
        $node = $this->createNode("RegExpLiteral", $token);
        $node->setRaw($token->value);
        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