diff options
Diffstat (limited to 'crates/ra_parser/src/grammar/items.rs')
-rw-r--r-- | crates/ra_parser/src/grammar/items.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 97642bc24..cca524cea 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs | |||
@@ -180,7 +180,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul | |||
180 | // unsafe const fn bar() {} | 180 | // unsafe const fn bar() {} |
181 | T![fn] => { | 181 | T![fn] => { |
182 | fn_def(p); | 182 | fn_def(p); |
183 | m.complete(p, FN_DEF); | 183 | m.complete(p, FN); |
184 | } | 184 | } |
185 | 185 | ||
186 | // test unsafe_trait | 186 | // test unsafe_trait |
@@ -193,7 +193,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul | |||
193 | // unsafe auto trait T {} | 193 | // unsafe auto trait T {} |
194 | T![trait] => { | 194 | T![trait] => { |
195 | traits::trait_def(p); | 195 | traits::trait_def(p); |
196 | m.complete(p, TRAIT_DEF); | 196 | m.complete(p, TRAIT); |
197 | } | 197 | } |
198 | 198 | ||
199 | // test unsafe_impl | 199 | // test unsafe_impl |
@@ -221,7 +221,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul | |||
221 | // unsafe default impl Foo {} | 221 | // unsafe default impl Foo {} |
222 | T![impl] => { | 222 | T![impl] => { |
223 | traits::impl_def(p); | 223 | traits::impl_def(p); |
224 | m.complete(p, IMPL_DEF); | 224 | m.complete(p, IMPL); |
225 | } | 225 | } |
226 | 226 | ||
227 | // test existential_type | 227 | // test existential_type |
@@ -304,10 +304,16 @@ fn extern_crate_item(p: &mut Parser, m: Marker) { | |||
304 | p.bump(T![extern]); | 304 | p.bump(T![extern]); |
305 | assert!(p.at(T![crate])); | 305 | assert!(p.at(T![crate])); |
306 | p.bump(T![crate]); | 306 | p.bump(T![crate]); |
307 | name_ref(p); | 307 | |
308 | if p.at(T![self]) { | ||
309 | p.bump(T![self]); | ||
310 | } else { | ||
311 | name_ref(p); | ||
312 | } | ||
313 | |||
308 | opt_alias(p); | 314 | opt_alias(p); |
309 | p.expect(T![;]); | 315 | p.expect(T![;]); |
310 | m.complete(p, EXTERN_CRATE_ITEM); | 316 | m.complete(p, EXTERN_CRATE); |
311 | } | 317 | } |
312 | 318 | ||
313 | pub(crate) fn extern_item_list(p: &mut Parser) { | 319 | pub(crate) fn extern_item_list(p: &mut Parser) { |
@@ -374,7 +380,7 @@ fn type_def(p: &mut Parser, m: Marker) { | |||
374 | types::type_(p); | 380 | types::type_(p); |
375 | } | 381 | } |
376 | p.expect(T![;]); | 382 | p.expect(T![;]); |
377 | m.complete(p, TYPE_ALIAS_DEF); | 383 | m.complete(p, TYPE_ALIAS); |
378 | } | 384 | } |
379 | 385 | ||
380 | pub(crate) fn mod_item(p: &mut Parser, m: Marker) { | 386 | pub(crate) fn mod_item(p: &mut Parser, m: Marker) { |