added
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 02 Dec 2013 03:57:38 +0000
changeset 219 599e6a6ab6c6
parent 218 8f3f8d82da8b
child 220 141041fc76b5
added
progs/compile-lexer.scala
--- a/progs/compile-lexer.scala	Sun Dec 01 10:18:50 2013 +0000
+++ b/progs/compile-lexer.scala	Mon Dec 02 03:57:38 2013 +0000
@@ -309,8 +309,8 @@
   (T ~ T_OP("-") ~ AExp) ==> { case ((x, y), z) => Aop("-", x, z): AExp } || T  
 lazy val T: Parser[List[Token], AExp] = 
   (F ~ T_OP("*") ~ T) ==> { case ((x, y), z) => Aop("*", x, z): AExp } || 
-  (F ~ T_OP("/") ~ T) ==> { case ((x, y), z) => Aop("*", x, z): AExp } || 
-  (F ~ T_OP("%") ~ T) ==> { case ((x, y), z) => Aop("*", x, z): AExp } || F
+  (F ~ T_OP("/") ~ T) ==> { case ((x, y), z) => Aop("/", x, z): AExp } || 
+  (F ~ T_OP("%") ~ T) ==> { case ((x, y), z) => Aop("%", x, z): AExp } || F
 lazy val F: Parser[List[Token], AExp] = 
   (T_LPAREN ~ AExp ~ T_RPAREN) ==> { case ((x, y), z) => y: AExp }|| 
   IdParser ==> { case x => Var(x): AExp } ||