aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-09-01 22:35:54 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-09-01 22:35:54 +0100
commit97ebb614aa7f9d79bfbeabcfb1107bc88c8c5f3f (patch)
tree78d01a4ae8be1f93c0b206f12596acb64f26e89e /src
parent3d2b80cf454e682ba1fcd094465b7ee1a94297dd (diff)
downloadmicro-lang-hs-97ebb614aa7f9d79bfbeabcfb1107bc88c8c5f3f.tar.gz
micro-lang-hs-97ebb614aa7f9d79bfbeabcfb1107bc88c8c5f3f.zip
Fix: if binNum fails, backtrack
Diffstat (limited to 'src')
-rw-r--r--src/Lexer.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Lexer.hs b/src/Lexer.hs
index 7d09752..1a7df62 100644
--- a/src/Lexer.hs
+++ b/src/Lexer.hs
@@ -27,7 +27,7 @@ binNum = do
seq n $ return n
integer :: Parser Integer
-integer = binNum <|> T.integer scanner
+integer = try binNum <|> T.integer scanner
parens :: Parser a -> Parser a
parens = T.parens scanner