Esempio n. 1
0
 /**
  * Run a MetaModel expression
  * @param string $expression
  * @throws ParsingException
  * @return mixed
  */
 public function run($expression)
 {
     // Parses the expression
     try {
         $ast = $this->parser->parse($expression);
     } catch (SyntaxErrorException $e) {
         throw new ParsingException($e->getMessage(), 0, $e);
     }
     return $ast->execute($this);
 }
Esempio n. 2
0
 /**
  * @test
  * @expectedException \JMS\Parser\SyntaxErrorException
  */
 public function selectorShouldNotBeNested()
 {
     $parser = Parser::create();
     $parser->parse('Article(1).Article(2)');
 }