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

Breadcrumb

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

function Parser::consumeWord

Consumes a word composed by characters a-z

Parameters

null|string $extraChar Extra character to match:

Return value

string

5 calls to Parser::consumeWord()
Parser::parseLiteralBoolNull in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a literal boolean or null value
Parser::parseLiteralRegex in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a literal regex
Parser::parseSelectorPartAttribute in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses an attribute selector part
Parser::parseSelectorPartPseudo in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a pseudo selector part
Parser::parseSelectorPartType in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a type selector part

File

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

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

protected function consumeWord($extraChar = null) {
    $buffer = "";
    while ($char = $this->getChar()) {
        if ($char >= "a" && $char <= "z" || $char >= "A" && $char <= "Z" || $extraChar !== null && $char === $extraChar) {
            $buffer .= $char;
            $this->index += 1;
        }
        else {
            break;
        }
    }
    return $buffer;
}

API Navigation

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