public function testInvalidOr()
 {
     $this->setExpectedException('Bit3\\Contao\\Merger2\\Constraint\\Parser\\ParserException', 'Invalid token, expect | got -');
     $stream = new InputStream('|-');
     $stream->next();
 }
Beispiel #2
0
 protected function parseConjunction(InputToken $token, InputStream $stream, NodeInterface $left)
 {
     if ($token->is(InputToken::TOKEN_SEPARATOR)) {
         $token = $stream->next();
     }
     $right = $this->parseUntil($stream, InputToken::TOKEN_SEPARATOR, InputToken::LIST_SEPARATOR, InputToken::CLOSE_BRACKET, InputToken::END_OF_STREAM);
     if (!$right) {
         return;
     }
     if ($token->is(InputToken::AND_CONJUNCTION)) {
         $node = new AndNode($left, $right);
         return $node;
     }
     if ($token->is(InputToken::OR_CONJUNCTION)) {
         $node = new OrNode($left, $right);
         return $node;
     }
     $this->unexpected($token);
 }