Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar.rs')
| -rw-r--r-- | crates/parser/src/grammar.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index fe6b904bd8..d3aa56c7eb 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -204,8 +204,9 @@ impl BlockLike { self == BlockLike::Block } - fn is_blocklike(kind: SyntaxKind) -> bool { - matches!(kind, BLOCK_EXPR | IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR) + fn is_blocklike(expr: &CompletedMarker, p: &Parser<'_>) -> bool { + matches!(expr.kind(), BLOCK_EXPR | IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR) + || (expr.last_token(p) == Some(T!['}']) && !matches!(expr.kind(), CLOSURE_EXPR)) } } |