Skip to content
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

Fix a few corner cases of new Number parsing #161

Merged
merged 1 commit into from
Feb 10, 2023
Merged

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Feb 10, 2023

If we encounter a decimal point, ensure we treat the Number as float instead of integer. For the case where we were almost overflowing, we eagerly widen, but if we don't actually overflow, we want to "unwiden" back to the next lowest integer type. Also fix a few String parsing cases.

At some point, we'll make parsing from a string more first-class, but for now, it works when calling the Parsers.parsenumber directly.

If we encounter a decimal point, ensure we treat the `Number` as float
instead of integer. For the case where we were _almost_ overflowing,
we eagerly widen, but if we don't actually overflow, we want to "unwiden"
back to the next lowest integer type. Also fix a few String parsing cases.

At some point, we'll make parsing from a string more first-class, but
for now, it works when calling the Parsers.parsenumber directly.
@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Base: 86.72% // Head: 86.74% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (98f67cc) compared to base (78699fc).
Patch coverage: 86.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
+ Coverage   86.72%   86.74%   +0.01%     
==========================================
  Files           9        9              
  Lines        1695     1705      +10     
==========================================
+ Hits         1470     1479       +9     
- Misses        225      226       +1     
Impacted Files Coverage Δ
src/floats.jl 89.71% <86.66%> (-0.48%) ⬇️
src/ints.jl 90.00% <0.00%> (+2.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@quinnj quinnj merged commit 25d723b into main Feb 10, 2023
@quinnj quinnj deleted the jq-number-fixups branch February 10, 2023 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant