mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
add await expr to ast
This commit is contained in:
parent
2830d1376b
commit
5ac9f5cdc7
4 changed files with 45 additions and 1 deletions
|
@ -220,6 +220,9 @@ pub enum Expr {
|
|||
expr: ExprId,
|
||||
name: Name,
|
||||
},
|
||||
Await {
|
||||
expr: ExprId,
|
||||
},
|
||||
Try {
|
||||
expr: ExprId,
|
||||
},
|
||||
|
@ -359,6 +362,7 @@ impl Expr {
|
|||
f(*rhs);
|
||||
}
|
||||
Expr::Field { expr, .. }
|
||||
| Expr::Await { expr }
|
||||
| Expr::Try { expr }
|
||||
| Expr::Cast { expr, .. }
|
||||
| Expr::Ref { expr, .. }
|
||||
|
@ -729,6 +733,10 @@ where
|
|||
};
|
||||
self.alloc_expr(Expr::Field { expr, name }, syntax_ptr)
|
||||
}
|
||||
ast::ExprKind::AwaitExpr(e) => {
|
||||
let expr = self.collect_expr_opt(e.expr());
|
||||
self.alloc_expr(Expr::Await { expr }, syntax_ptr)
|
||||
}
|
||||
ast::ExprKind::TryExpr(e) => {
|
||||
let expr = self.collect_expr_opt(e.expr());
|
||||
self.alloc_expr(Expr::Try { expr }, syntax_ptr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue