aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
diff options
context:
space:
mode:
authorUnreal Hoang <[email protected]>2019-07-20 09:41:31 +0100
committerUnreal Hoang <[email protected]>2019-07-20 09:41:31 +0100
commit3a7f07c62d3dd253d63c483ee291d9471f539479 (patch)
tree7a717bb2a51489b4e1bc50895bff45f1e217f15c /crates/ra_parser/src/grammar
parente18f8495d6569f4fc0b7457b65a1d199cf7b5974 (diff)
add await to syntax, parser for await_expr
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index 298030cb9..3e49e70c7 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -393,6 +393,18 @@ fn postfix_expr(
393 T![.] if p.nth(1) == IDENT && (p.nth(2) == T!['('] || p.nth(2) == T![::]) => { 393 T![.] if p.nth(1) == IDENT && (p.nth(2) == T!['('] || p.nth(2) == T![::]) => {
394 method_call_expr(p, lhs) 394 method_call_expr(p, lhs)
395 } 395 }
396 T![.] if p.nth(1) == AWAIT_KW => {
397 // test await_expr
398 // fn foo() {
399 // x.await;
400 // x.0.await;
401 // x.0().await?.hello();
402 // }
403 let m = lhs.precede(p);
404 p.bump();
405 p.bump();
406 m.complete(p, AWAIT_EXPR)
407 }
396 T![.] => field_expr(p, lhs), 408 T![.] => field_expr(p, lhs),
397 // test postfix_range 409 // test postfix_range
398 // fn foo() { let x = 1..; } 410 // fn foo() { let x = 1..; }