diff --git a/example/1.hear b/example/1.hear index 44fe560..265a993 100644 --- a/example/1.hear +++ b/example/1.hear @@ -1,5 +1,5 @@ printInt(5*(3-2)+-4-4); printBool(true); printBool(false); -printBool(5 * 3 > 5 + 9); +printBool(5 * 3 >= 5 + 9); printBool(5*(3-2)+-4-4 < -3); \ No newline at end of file diff --git a/src/Main/Parser/Megaparsec.hs b/src/Main/Parser/Megaparsec.hs index 3f2c922..3281b77 100644 --- a/src/Main/Parser/Megaparsec.hs +++ b/src/Main/Parser/Megaparsec.hs @@ -59,12 +59,12 @@ intOrdCmpExpr = do b <- intExpr a <- choice - [ M.GT <$ symbol ">", - M.GTE <$ symbol ">=", + [ M.GTE <$ string ">=" <* C.space, + M.LTE <$ string "<=" <* C.space, + M.GT <$ string ">" <* C.space, -- M.Eq <$ string "==", -- M.Neq <$ string "!=", - M.LTE <$ symbol "<=", - M.LT <$ symbol "<" + M.LT <$ string "<" <* C.space ] c <- intExpr return (a, b, c)