LeopoldArkham / Molten

[WIP] Molten - Style-preserving TOML parser.
Apache License 2.0
40 stars 8 forks source link

Parser accepts invalid numerical values #10

Closed LeopoldArkham closed 6 years ago

LeopoldArkham commented 7 years ago

The spec states:

"Similar to integers, you may use underscores to enhance readability. Each underscore must be surrounded by at least one digit."

I think we currently allow leading and trailing underscores: This should be fixed. Auditing that part of the code to makes sure there aren't any other issues regarding what we allow/disallow regarding ints and floats would be a good thing in general.

This should probably be looked at together with #2

The code for this is in the Int, float, datetime arm of the parse_val() function in parser.rs

kimsnj commented 6 years ago

Hey,

I am still pretty new to Rust. But I'll give a try at this issue. Started to look around. I should be able to open a PR during the week-end.