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 various float parsing issues #99

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

darichey
Copy link
Contributor

@darichey darichey commented Jul 12, 2022

Summary & Motivation

Fixes parsing of expressions like .5e1 which are valid floats in Nix.

I simply extracted the logic which applies to similar expressions with leading digits (e.g., 1.5e1) and called it in both places.

Edit: Now also fixes parsing of expresions like 1. and 1e+3 (scientific notation with a plus).

@ncfavier
Copy link
Member

Does this also fix parsing for 1. ?

@darichey
Copy link
Contributor Author

It does not. I can look into that!

src/tokenizer.rs Outdated Show resolved Hide resolved
@darichey darichey changed the title Fix scientific notation parsing with no leading digits Fix various float parsing issues Jul 28, 2022
@darichey
Copy link
Contributor Author

@ncfavier @oberblastmeister both of those issues should be fixed now as well!

@oberblastmeister oberblastmeister merged commit fd1f0af into nix-community:master Jul 29, 2022
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.

3 participants