diff options
author | Mikhail Rakhmanov <[email protected]> | 2020-06-03 19:10:54 +0100 |
---|---|---|
committer | Mikhail Rakhmanov <[email protected]> | 2020-06-03 19:10:54 +0100 |
commit | eefa10bc6bff3624ddd0bbb6bc89d8beb4bed186 (patch) | |
tree | 15c38c2993c52f4065d338090ca9185cc1fcd3da /crates/ra_parser/src/grammar | |
parent | a9d567584857b1be4ca8eaa5ef2c7d85f7b2845e (diff) | |
parent | 794f6da821c5d6e2490b996baffe162e4753262d (diff) |
Merge branch 'master' into assists_extract_enum
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 34f039768..d6e8df32a 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -325,13 +325,27 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> | |||
325 | let kind = match p.current() { | 325 | let kind = match p.current() { |
326 | // test ref_expr | 326 | // test ref_expr |
327 | // fn foo() { | 327 | // fn foo() { |
328 | // // reference operator | ||
328 | // let _ = &1; | 329 | // let _ = &1; |
329 | // let _ = &mut &f(); | 330 | // let _ = &mut &f(); |
331 | // let _ = &raw; | ||
332 | // let _ = &raw.0; | ||
333 | // // raw reference operator | ||
334 | // let _ = &raw mut foo; | ||
335 | // let _ = &raw const foo; | ||
330 | // } | 336 | // } |
331 | T![&] => { | 337 | T![&] => { |
332 | m = p.start(); | 338 | m = p.start(); |
333 | p.bump(T![&]); | 339 | p.bump(T![&]); |
334 | p.eat(T![mut]); | 340 | if p.at(IDENT) |
341 | && p.at_contextual_kw("raw") | ||
342 | && (p.nth_at(1, T![mut]) || p.nth_at(1, T![const])) | ||
343 | { | ||
344 | p.bump_remap(T![raw]); | ||
345 | p.bump_any(); | ||
346 | } else { | ||
347 | p.eat(T![mut]); | ||
348 | } | ||
335 | REF_EXPR | 349 | REF_EXPR |
336 | } | 350 | } |
337 | // test unary_expr | 351 | // test unary_expr |