Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch02/parsing/exercise_4.hs has a bug. #2

Open
wind2412 opened this issue Mar 27, 2018 · 0 comments
Open

ch02/parsing/exercise_4.hs has a bug. #2

wind2412 opened this issue Mar 27, 2018 · 0 comments

Comments

@wind2412
Copy link

If we use

main = do
print (parse parseExpr "err..." "#t")

, the bug will occur:

Left "err..." (line 1, column 2):
unexpected "t"
expecting "d", "b", "o" or "x"

Because parseNumber conflicts with parseBool. It will consume a # symbol.
Changing code at line 97 to be <|> try parseNumber will fix the bug;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant