Fix GTE and LTE not parsing

pull/29/head
Ethan Reece 2023-10-14 20:54:59 -05:00
parent a75b0df9bc
commit f436c6bc71
Signed by: me
GPG Key ID: D3993665FF92E1C3
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
printInt(5*(3-2)+-4-4); printInt(5*(3-2)+-4-4);
printBool(true); printBool(true);
printBool(false); printBool(false);
printBool(5 * 3 > 5 + 9); printBool(5 * 3 >= 5 + 9);
printBool(5*(3-2)+-4-4 < -3); printBool(5*(3-2)+-4-4 < -3);

View File

@ -59,12 +59,12 @@ intOrdCmpExpr = do
b <- intExpr b <- intExpr
a <- a <-
choice choice
[ M.GT <$ symbol ">", [ M.GTE <$ string ">=" <* C.space,
M.GTE <$ symbol ">=", M.LTE <$ string "<=" <* C.space,
M.GT <$ string ">" <* C.space,
-- M.Eq <$ string "==", -- M.Eq <$ string "==",
-- M.Neq <$ string "!=", -- M.Neq <$ string "!=",
M.LTE <$ symbol "<=", M.LT <$ string "<" <* C.space
M.LT <$ symbol "<"
] ]
c <- intExpr c <- intExpr
return (a, b, c) return (a, b, c)