From b6778be91900b8161e705dc2598ef7af86842b0b Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Wed, 2 Nov 2011 14:34:35 +0000 Subject: Begone t1737... --- test/files/run/packrat1.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/files/run/packrat1.scala') diff --git a/test/files/run/packrat1.scala b/test/files/run/packrat1.scala index 31a1ea55e5..b5a4687378 100644 --- a/test/files/run/packrat1.scala +++ b/test/files/run/packrat1.scala @@ -21,15 +21,15 @@ object Test extends App{ } object grammars extends StandardTokenParsers with PackratParsers{ - + def extractResult(r : ParseResult[_]) = r match { case Success(a,_) => a case NoSuccess(a,_) => a } - + lexical.delimiters ++= List("+","-","*","/","(",")") lexical.reserved ++= List("Hello","World") - + /**** * term = term + fact | term - fact | fact * fact = fact * num | fact / num | num @@ -39,7 +39,7 @@ object grammars extends StandardTokenParsers with PackratParsers{ val term: PackratParser[Int] = (term~("+"~>fact) ^^ {case x~y => x+y} |term~("-"~>fact) ^^ {case x~y => x-y} |fact) - + val fact: PackratParser[Int] = (fact~("*"~>numericLit) ^^ {case x~y => x*y.toInt} |fact~("/"~>numericLit) ^^ {case x~y => x/y.toInt} |"("~>term<~")" -- cgit v1.2.3