Skip to content

Commit

Permalink
Fix the num_lit grammar in the reference manual.
Browse files Browse the repository at this point in the history
- Cause `0` to be considered a valid integer literal (it is).
- Add octal literals (missed from #10243).

I have *not* modified doc/po/rust.md.pot or doc/po/ja/rust.md.po at all;
they already seem to be out of date so it's easier to ignore them for
myself. I can update them if desired, of course.
  • Loading branch information
chris-morgan committed Nov 16, 2013
1 parent 90754ae commit 9fa32c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ common_escape : '\x5c'
hex_digit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
| 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
| dec_digit ;
oct_digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' ;
dec_digit : '0' | nonzero_dec ;
nonzero_dec: '1' | '2' | '3' | '4'
| '5' | '6' | '7' | '8' | '9' ;
Expand Down Expand Up @@ -318,8 +319,9 @@ r##"foo #"# bar"##; // foo #"# bar
~~~~ {.ebnf .gram}
num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?
| '0' [ [ dec_digit | '_' ] + num_suffix ?
| '0' [ [ dec_digit | '_' ] * num_suffix ?
| 'b' [ '1' | '0' | '_' ] + int_suffix ?
| 'o' [ oct_digit | '_' ] + int_suffix ?
| 'x' [ hex_digit | '_' ] + int_suffix ? ] ;
num_suffix : int_suffix | float_suffix ;
Expand Down

5 comments on commit 9fa32c0

@bors
Copy link
Contributor

@bors bors commented on 9fa32c0 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from cmr
at chris-morgan@9fa32c0

@bors
Copy link
Contributor

@bors bors commented on 9fa32c0 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging chris-morgan/rust/fix-num_lit-grammar-in-the-reference-manaul = 9fa32c0 into auto

@bors
Copy link
Contributor

@bors bors commented on 9fa32c0 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chris-morgan/rust/fix-num_lit-grammar-in-the-reference-manaul = 9fa32c0 merged ok, testing candidate = 6c8e337

@bors
Copy link
Contributor

@bors bors commented on 9fa32c0 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 9fa32c0 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 6c8e337

Please sign in to comment.