winnow-rs / winnow

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

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

Closed dezyh closed 10 months ago

dezyh commented 10 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 10 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 10 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