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

Breadcrumb

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

function Parser::parseLiteralString

Parses a literal string

Return value

string|null

Throws

Exception

1 call to Parser::parseLiteralString()
Parser::parseLiteral in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a literal value

File

vendor/mck89/peast/lib/Peast/Selector/Parser.php, line 393

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

protected function parseLiteralString() {
    if (!($quote = $this->consumeAny(array(
        "'",
        '"',
    ), true))) {
        return null;
    }
    if (($str = $this->consumeUntil($quote)) === null) {
        throw new Exception("Unterminated string in attribute value");
    }
    return $str;
}

API Navigation

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