/** * @dataProvider expressionParser */ public function testExpressionParser($tokens, $nodes) { # Append EOF Token $tokens[] = new Token(null, '', TokenTypes::T_EOF, 0, 0); $parser = new Parser(new TokenStream($tokens), $this->getEnvironment()->addExtension(new Core())); $expr = new Parser\ExpressionParser($parser); $node = $expr->parseExpression(); $this->assertEquals($nodes, $node); }
public function parseExpression() { return $this->expressionParser->parseExpression(); }