-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Overflow parsing uint64 #34
Comments
Ah, huh. Definitely needs a few failf calls in there. |
I can make a PR if that will help. Would just need some direction. |
That would be appreciated. It just needs calls to panicf() in an else clause for each one. If you don't get to it I will soonish. |
Actually after taking a bit of a closer look I realised this is (somewhat) deliberate. If Participle encounters non-numeric tokens being captured into numeric fields it treats the field as a counter and increments it. That is useful for certain types of grammar features. On the other hand, it is also very confusing when you don't want that behaviour. I think I will remove that feature. It can be replicated with a custom |
There isn't any error handling in this code: https://github.com/alecthomas/participle/blob/master/nodes.go#L302-L307
I'm trying to reject values larger than 2^64. When I add some logging in that block, I get this:
However, the value I get is 1 with no parsing errors.
The text was updated successfully, but these errors were encountered: