You are here

protected function XPathQueryParser::handleWordBoundary in Feeds XPath Parser 8

Handles word boundaries.

Parameters

string $c: One character.

1 call to XPathQueryParser::handleWordBoundary()
XPathQueryParser::start in lib/Drupal/feeds_xpathparser/XPathQueryParser.php
Begin parsing.

File

lib/Drupal/feeds_xpathparser/XPathQueryParser.php, line 136
Contains \Drupal\feeds_xpathparser\XPathQueryParser.

Class

XPathQueryParser
Pseudo-parser of XPath queries.

Namespace

Drupal\feeds_xpathparser

Code

protected function handleWordBoundary($c) {
  if (in_array($this->word, array(
    'div',
    'or',
    'and',
    'mod',
  )) && $this->prevBoundary === ' ' && $c === ' ') {
    $this->output .= $this->word;
  }
  else {
    $this
      ->handleWord($c);
  }
  $this->output .= $c;
  $this->word = '';
  $this->prevBoundary = $c;
}