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

Allow underscores in numeric literals for improved readability? #4108

Closed
scottjmaddox opened this issue Jan 8, 2020 · 1 comment
Closed
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.

Comments

@scottjmaddox
Copy link

In Rust, underscores can be inserted in numeric literals to improve readability, e.g. 1_000 is the same as 1000, and 0.000_001 is the same as 0.000001. This can be especially helpful for large binary and hex literals, e.g. 0b0101000100001001 vs. 0b0101_0001_0000_1001.

Supporting this would be a pretty minor change to the grammar and lexer, and would be backwards compatible (i.e. it would not break currently working code).

@daurnimator
Copy link
Collaborator

daurnimator commented Jan 8, 2020

Duplicate of #504, #3983

@daurnimator daurnimator marked this as a duplicate of #3983 Jan 8, 2020
@daurnimator daurnimator added duplicate proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. labels Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
Development

No branches or pull requests

2 participants