mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
add await to syntax, parser for await_expr
This commit is contained in:
parent
e18f8495d6
commit
3a7f07c62d
5 changed files with 93 additions and 0 deletions
|
@ -393,6 +393,18 @@ fn postfix_expr(
|
|||
T![.] if p.nth(1) == IDENT && (p.nth(2) == T!['('] || p.nth(2) == T![::]) => {
|
||||
method_call_expr(p, lhs)
|
||||
}
|
||||
T![.] if p.nth(1) == AWAIT_KW => {
|
||||
// test await_expr
|
||||
// fn foo() {
|
||||
// x.await;
|
||||
// x.0.await;
|
||||
// x.0().await?.hello();
|
||||
// }
|
||||
let m = lhs.precede(p);
|
||||
p.bump();
|
||||
p.bump();
|
||||
m.complete(p, AWAIT_EXPR)
|
||||
}
|
||||
T![.] => field_expr(p, lhs),
|
||||
// test postfix_range
|
||||
// fn foo() { let x = 1..; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue