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

Rollup of 7 pull requests #24786

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f1b40d7
Remove duplicate feature gate tests
lgrz Apr 20, 2015
38c3b62
Byte string literals are now fixed-size arrays
nwin Apr 24, 2015
b179f2b
Reference manual 3.5.2.1.5
SkylerLipthay Apr 24, 2015
15c3435
Remove reference to 'to'
steveklabnik Apr 24, 2015
7972fbb
[reference] Fix missing formatting.
mbrubeck Apr 24, 2015
331821e
[reference] Update 7.2.20: For expressions.
mbrubeck Apr 24, 2015
441e39f
Unrot and re-enable `run-pass-fulldeps/qquote.rs`
tamird Apr 23, 2015
c3f1d18
Re-enable test
tamird Apr 23, 2015
e22dd3e
`qquote-1.rs` -> `compile-fail-fulldeps/qquote.rs`
tamird Apr 23, 2015
1cc7b51
`qquote-2.rs` -> `run-fail/qquote.rs`
tamird Apr 23, 2015
8cf2552
Remove ebnf from reference
mdinger Apr 24, 2015
9ecfdad
Updates to grammar
mdinger Apr 24, 2015
7089c5e
Remove keywords from reference because they're already in grammar
mdinger Apr 24, 2015
da7d86e
Rollup merge of #24718 - tamird:fix-quote-tests, r=alexcrichton
steveklabnik Apr 24, 2015
1640b0c
Rollup merge of #24729 - mdinger:reference_grammar, r=steveklabnik
steveklabnik Apr 24, 2015
02ae888
Rollup merge of #24751 - lstat:feature-gate-22820-dups, r=brson
steveklabnik Apr 24, 2015
755f18f
Rollup merge of #24766 - nwin:patch-1, r=steveklabnik
steveklabnik Apr 24, 2015
3eec8fb
Rollup merge of #24769 - SkylerLipthay:patch-1, r=steveklabnik
steveklabnik Apr 24, 2015
a80b566
Rollup merge of #24772 - steveklabnik:gh24712, r=alexcrichton
steveklabnik Apr 24, 2015
9e5adc2
Rollup merge of #24775 - mbrubeck:reference, r=steveklabnik
steveklabnik Apr 24, 2015
ad9da5e
More small syntax changes in reference.md
Apr 24, 2015
1f8dc51
Add examples by @pnkfelix to fmt precision
steveklabnik Apr 21, 2015
7437604
TRPL: deref coercions
steveklabnik Apr 23, 2015
999ea35
TRPL: mutability
steveklabnik Apr 23, 2015
5ce2fae
TRPL: operators and overloading
steveklabnik Apr 23, 2015
37aa193
Whoops, please tidy
steveklabnik Apr 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ token : simple_token | ident | literal | symbol | whitespace token ;

<p id="keyword-table-marker"></p>

| | | | | |
|----------|----------|----------|----------|--------|
| abstract | alignof | as | become | box |
| break | const | continue | crate | do |
| else | enum | extern | false | final |
| fn | for | if | impl | in |
| let | loop | match | mod | move |
| mut | offsetof | once | override | priv |
| proc | pub | pure | ref | return |
| sizeof | static | self | struct | super |
| true | trait | type | typeof | unsafe |
| unsized | use | virtual | where | while |
| yield | | | | |
| | | | | |
|----------|----------|----------|----------|---------|
| abstract | alignof | as | become | box |
| break | const | continue | crate | do |
| else | enum | extern | false | final |
| fn | for | if | impl | in |
| let | loop | macro | match | mod |
| move | mut | offsetof | override | priv |
| proc | pub | pure | ref | return |
| Self | self | sizeof | static | struct |
| super | trait | true | type | typeof |
| unsafe | unsized | use | virtual | where |
| while | yield | | | |


Each of these keywords has special meaning in its grammar, and all of them are
Expand Down Expand Up @@ -524,6 +524,15 @@ array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
idx_expr : expr '[' expr ']' ;
```

### Range expressions

```antlr
range_expr : expr ".." expr |
expr ".." |
".." expr |
".." ;
```

### Unary operator expressions

**FIXME:** grammar?
Expand Down Expand Up @@ -610,7 +619,7 @@ lambda_expr : '|' ident_list '|' expr ;
### While loops

```antlr
while_expr : "while" no_struct_literal_expr '{' block '}' ;
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
```

### Infinite loops
Expand All @@ -634,7 +643,7 @@ continue_expr : "continue" [ lifetime ];
### For expressions

```antlr
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
```

### If expressions
Expand Down
Loading