diff options
Diffstat (limited to 'crates/ra_parser/src/grammar.rs')
-rw-r--r-- | crates/ra_parser/src/grammar.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index caedeead0..c2e1d701e 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -142,19 +142,19 @@ pub(crate) fn reparser( | |||
142 | ) -> Option<fn(&mut Parser)> { | 142 | ) -> Option<fn(&mut Parser)> { |
143 | let res = match node { | 143 | let res = match node { |
144 | BLOCK_EXPR => expressions::block_expr, | 144 | BLOCK_EXPR => expressions::block_expr, |
145 | RECORD_FIELD_DEF_LIST => items::record_field_def_list, | 145 | RECORD_FIELD_LIST => items::record_field_def_list, |
146 | RECORD_FIELD_LIST => items::record_field_list, | 146 | RECORD_EXPR_FIELD_LIST => items::record_field_list, |
147 | ENUM_VARIANT_LIST => items::enum_variant_list, | 147 | VARIANT_LIST => items::enum_variant_list, |
148 | MATCH_ARM_LIST => items::match_arm_list, | 148 | MATCH_ARM_LIST => items::match_arm_list, |
149 | USE_TREE_LIST => items::use_tree_list, | 149 | USE_TREE_LIST => items::use_tree_list, |
150 | EXTERN_ITEM_LIST => items::extern_item_list, | 150 | EXTERN_ITEM_LIST => items::extern_item_list, |
151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, | 151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, |
152 | ITEM_LIST => match parent? { | 152 | ASSOC_ITEM_LIST => match parent? { |
153 | IMPL_DEF => items::impl_item_list, | 153 | IMPL => items::impl_item_list, |
154 | TRAIT_DEF => items::trait_item_list, | 154 | TRAIT => items::trait_item_list, |
155 | MODULE => items::mod_item_list, | ||
156 | _ => return None, | 155 | _ => return None, |
157 | }, | 156 | }, |
157 | ITEM_LIST => items::mod_item_list, | ||
158 | _ => return None, | 158 | _ => return None, |
159 | }; | 159 | }; |
160 | Some(res) | 160 | Some(res) |
@@ -224,7 +224,7 @@ fn opt_alias(p: &mut Parser) { | |||
224 | if !p.eat(T![_]) { | 224 | if !p.eat(T![_]) { |
225 | name(p); | 225 | name(p); |
226 | } | 226 | } |
227 | m.complete(p, ALIAS); | 227 | m.complete(p, RENAME); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
@@ -270,10 +270,6 @@ fn name_ref(p: &mut Parser) { | |||
270 | let m = p.start(); | 270 | let m = p.start(); |
271 | p.bump(IDENT); | 271 | p.bump(IDENT); |
272 | m.complete(p, NAME_REF); | 272 | m.complete(p, NAME_REF); |
273 | } else if p.at(T![self]) { | ||
274 | let m = p.start(); | ||
275 | p.bump(T![self]); | ||
276 | m.complete(p, T![self]); | ||
277 | } else { | 273 | } else { |
278 | p.err_and_bump("expected identifier"); | 274 | p.err_and_bump("expected identifier"); |
279 | } | 275 | } |