private function P() {
$node = $this->next();
if ($node instanceof Operator) {
if ($node->hasUnaryMode) {
$this->pushOperator($node, Operator::MODE_UNARY);
$this->consume();
$this->P();
}
else {
throw new ParserException($node->getSourcePosition(), 'unexpected ' . $node->getOperator() . ' operator!');
}
}
I ended up hitting this when I had Twig debug mode turned on in my D8 site and attempted to run drush dmu-upgrade pants (see sister issue at https://www.drupal.org/node/2408745).
Drush outputs just:
"(Error at 3:1: unexpected < operator!)"
Which unfortunately, doesn't clue me in to what's wrong.
Would be great if this were something instead like:
"(Error at $filename, line 3:1: unexpected < operator in string $string!)"
Also, there may be a BUG bug with the fact that it died when it encountered comments in the source but I'm not sure if that's a Drupal problem, a Pharborist problem, or a DMU problem. Here's the backtrace in case it's helpful:
Relevant code in the "else" branch:
I ended up hitting this when I had Twig debug mode turned on in my D8 site and attempted to run drush dmu-upgrade pants (see sister issue at https://www.drupal.org/node/2408745).
Drush outputs just:
"(Error at 3:1: unexpected < operator!)"
Which unfortunately, doesn't clue me in to what's wrong.
Would be great if this were something instead like:
"(Error at $filename, line 3:1: unexpected < operator in string $string!)"
Also, there may be a BUG bug with the fact that it died when it encountered comments in the source but I'm not sure if that's a Drupal problem, a Pharborist problem, or a DMU problem. Here's the backtrace in case it's helpful: