aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-21 10:04:00 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-21 10:04:00 +0000
commit463e5af3f2ff54b74e4aeb73e75047c00b6339be (patch)
tree00b56f7f72ceee1a6ebc11ff3a4cfae54782eaf7 /crates/ra_syntax/src
parent4f7ec0170353e61c148909d2716c915578392a7b (diff)
parent9beee92500bfb5953717a67c18217722ea82be49 (diff)
Merge #306
306: Finish weird exprs r=DJMcNab a=DJMcNab Fix #290. Note that I'm not certain my use of `p.nth(1) == Ident` is entirely consistent with `libsyntax` - in the original, [`is_union_item`](https://github.com/rust-lang/rust/blob/9622f9dc4745eb59fd229477f453ae83e8044db9/src/libsyntax/parse/parser.rs#L4593-L4596) uses `t.is_ident() && !t.is_reserved_ident()`, whereas we effectively only do `is_ident`. However, I cannot find the definition of `is_reserved_ident` (even searching the rust repository only gives uses, no definitions), so this will have to do unless someone else can find it :|. Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/grammar/items.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/grammar/items.rs b/crates/ra_syntax/src/grammar/items.rs
index b646dd070..aa5fe0777 100644
--- a/crates/ra_syntax/src/grammar/items.rs
+++ b/crates/ra_syntax/src/grammar/items.rs
@@ -202,7 +202,7 @@ fn items_without_modifiers(p: &mut Parser) -> Option<SyntaxKind> {
202 } 202 }
203 STRUCT_DEF 203 STRUCT_DEF
204 } 204 }
205 IDENT if p.at_contextual_kw("union") => { 205 IDENT if p.at_contextual_kw("union") && p.nth(1) == IDENT => {
206 // test union_items 206 // test union_items
207 // union Foo {} 207 // union Foo {}
208 // union Foo { 208 // union Foo {