We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi everyone,
I stumbled upon odd behaviour regarding leading zeros:
> Parser.run Parser.int "0123" Ok 0 : Result (List Parser.DeadEnd) Int > Parser.run Parser.float "0123" Ok 0 : Result (List Parser.DeadEnd) Float
The documentation suggests that this would cause an Err-Result. (at least for Parser.int)
Err
Parser.int
I personally expected python-like behaviour:
>>> int("0123") 123 >>> float("0123") 123.0
In any case, Ok 0 makes the user think, the input was correctly parsed, when in fact it was not.
Ok 0
I want to thank you for your work in the elm community and especially the nice design of the elm/parser. It's a blast to work with so far.
elm/parser
I'd be happy to contribute to a fix, if you too see this as a bug.
The text was updated successfully, but these errors were encountered:
Just noticed this too.
Sorry, something went wrong.
Parser.float
No branches or pull requests
Hi everyone,
I stumbled upon odd behaviour regarding leading zeros:
Observed
Expected
The documentation suggests that this would cause an
Err
-Result. (at least forParser.int
)I personally expected python-like behaviour:
In any case,
Ok 0
makes the user think, the input was correctly parsed, when in fact it was not.Final Thoughts
I want to thank you for your work in the elm community and especially the nice design of the
elm/parser
. It's a blast to work with so far.I'd be happy to contribute to a fix, if you too see this as a bug.
The text was updated successfully, but these errors were encountered: