winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
525 stars 40 forks source link

Fixes `winnow::ascii::float` not matching `+inf` or `-inf` #412

Closed dezyh closed 9 months ago

dezyh commented 9 months ago

Fixes winnow::ascii::float not matching any variants of inf/infinite prefixed by a +/- sign as mentioned in https://github.com/winnow-rs/winnow/issues/411.

dezyh commented 9 months ago

In retrospect, I noticed the infinite float values are actually comparable to themselves ("Infinite operands of the same sign shall compare equal") (unlike NaN), so we could move all the infinity variants into the main test_cases which makes my refactoring changes a little redundant.

Let me know what you think.

epage commented 9 months ago

In retrospect, I noticed the infinite float values are actually comparable to themselves ("Infinite operands of the same sign shall compare equal") (unlike NaN), so we could move all the infinity variants into the main test_cases which makes my refactoring changes a little redundant.

Let me know what you think.

I can go either way on this