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

Breadcrumb

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

function Parser::consumeCombinator

Consumes a combinator

Return value

string|null

1 call to Parser::consumeCombinator()
Parser::parseSelector in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a selector

File

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

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

protected function consumeCombinator() {
    
    //Initial ws can be trimmed if followed by another combinator
    $ws = $this->consumeWhitespaces();
    if ($combinator = $this->consumeAny($this->combinators, true)) {
        $this->consumeWhitespaces();
    }
    elseif ($ws) {
        
        //If there's no other combinators use the space
        $combinator = " ";
    }
    else {
        $combinator = null;
    }
    return $combinator;
}

API Navigation

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