Skip to content

Number grammar #1589

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

Closed
mikesamuel opened this issue Jan 21, 2012 · 2 comments
Closed

Number grammar #1589

mikesamuel opened this issue Jan 21, 2012 · 2 comments
Labels
A-grammar Area: The grammar of Rust E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@mikesamuel
Copy link

http://doc.rust-lang.org/doc/rust.html#number-literals

The number literal grammar in 3.5.3.2 has one probable type and a few surprising consequences that may not be spec errors.

num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?
    | '0' [       [ dec_digit | '_' ] + num_suffix ?
          | 'b'   [ '1' | '0' | '_' ] + int_suffix ?
          | 'x'   [ hex_digit | '-' ] + int_suffix ? ] ;

0x-0 is a number literal. This is not an ambiguity, but perhaps the '-' should be a '_'.

Nits:

0b_ is a valid binary literal and 0x_ is a valid hex literal which is surprising but not ambiguous.

Hex digits can be mixed case but the letter indicating the base cannot be -- 0xABCD is ok, but 0XABCD is not.

@ghost ghost assigned graydon Apr 12, 2012
@graydon
Copy link
Contributor

graydon commented Apr 25, 2013

relative of #2234

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

This was fixed long ago. Closing.

@graydon graydon closed this as completed Aug 15, 2013
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Added GH action script for kani.

* Adjusted script: no input, clear path.

* Documented CI integration.

* Forgot to commit ci docs.

* Added user configuration doc lost in recovery.

* Removed repeated paragraph.

* Added image version and release check for that image version.

* fixed capitalization.

Co-authored-by: Adrian Palacios <[email protected]>

* fixed capitalization.

Co-authored-by: Adrian Palacios <[email protected]>

* fixed capitalization.

Co-authored-by: Adrian Palacios <[email protected]>

* Adjusted wording.

* Added command input for action, and associated docs.

* Added action and image check after docker image push.

* Adjusted env varaibles.

* Changed wording in README.

* Made string checks more precise.

* Increment version.

Co-authored-by: Adrian Palacios <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants