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

Breadcrumb

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

function Parser::consume

Consumes the current character if it is equal to the given one

Parameters

string $char Character to compare:

Return value

string|null

4 calls to Parser::consume()
Parser::parseLiteralRegex in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a literal regex
Parser::parseSelector in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a selector
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

File

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

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

protected function consume($char) {
    if ($this->getChar() === $char) {
        $this->index++;
        return $char;
    }
    return null;
}

API Navigation

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