diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-09-01 22:35:54 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-09-01 22:35:54 +0100 |
commit | 97ebb614aa7f9d79bfbeabcfb1107bc88c8c5f3f (patch) | |
tree | 78d01a4ae8be1f93c0b206f12596acb64f26e89e | |
parent | 3d2b80cf454e682ba1fcd094465b7ee1a94297dd (diff) | |
download | micro-lang-hs-97ebb614aa7f9d79bfbeabcfb1107bc88c8c5f3f.tar.gz micro-lang-hs-97ebb614aa7f9d79bfbeabcfb1107bc88c8c5f3f.zip |
Fix: if binNum fails, backtrack
-rw-r--r-- | src/Lexer.hs | 2 |
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 |