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

plus sign on unsigned integers #445

Closed
Tracked by #397
ModProg opened this issue Mar 30, 2023 · 2 comments · Fixed by #479
Closed
Tracked by #397

plus sign on unsigned integers #445

ModProg opened this issue Mar 30, 2023 · 2 comments · Fixed by #479
Labels
easy An issue that's easy to implement good first issue Perfect for new contributors

Comments

@ModProg
Copy link
Contributor

ModProg commented Mar 30, 2023

I don't see a reason why + should only be allowed on signed integers.

Currently this fails:

    assert_eq!(
        std::u64::MAX,
        from_str("+19").unwrap()
    );
@torkleyy
Copy link
Contributor

Should probably be supported, but the spec isn't explicitly allowing it atm:

https://github.com/ron-rs/ron/blob/master/docs/grammar.md#numbers

@juntyr
Copy link
Member

juntyr commented Mar 30, 2023

I have to admit I thought they were allowed until I looked at the spec. Since this would expand allowed RON, I don't see why we couldn't modify the spec and parser. The one footgun might be around schema-less parsing, since we would now deserialise "+19" as an unsigned integer and currently only store either a f64 or i64 inside Value. I've been meaning to extend that to all supported ints at some point anyways ...

@juntyr juntyr added easy An issue that's easy to implement good first issue Perfect for new contributors labels Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy An issue that's easy to implement good first issue Perfect for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants