Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/expressions/atom.rs')
| -rw-r--r-- | crates/parser/src/grammar/expressions/atom.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 53dbbfea75..4b7a1b31fb 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs @@ -72,14 +72,10 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar T!['('] => tuple_expr(p), T!['['] => array_expr(p), T![|] => closure_expr(p), - T![move] if la == T![|] => closure_expr(p), - T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => closure_expr(p), - T![static] - if la == T![|] - || (la == T![move] && p.nth(2) == T![|]) - || (la == T![async] && p.nth(2) == T![|]) - || (la == T![async] && p.nth(2) == T![move] && p.nth(3) == T![|]) => - { + T![static] | T![async] | T![move] if la == T![|] => closure_expr(p), + T![static] | T![async] if la == T![move] && p.nth(2) == T![|] => closure_expr(p), + T![static] if la == T![async] && p.nth(2) == T![|] => closure_expr(p), + T![static] if la == T![async] && p.nth(2) == T![move] && p.nth(3) == T![|] => { closure_expr(p) } T![if] => if_expr(p), |