Merge commit '9b3d03408c' into sync-from-ra

This commit is contained in:
Laurențiu Nicola 2023-08-21 12:44:09 +03:00
parent 883f16d805
commit 30d8aa1bec
136 changed files with 3865 additions and 1451 deletions

View file

@ -61,6 +61,14 @@ impl ast::BlockExpr {
pub fn tail_expr(&self) -> Option<ast::Expr> {
self.stmt_list()?.tail_expr()
}
/// Block expressions accept outer and inner attributes, but only when they are the outer
/// expression of an expression statement or the final expression of another block expression.
pub fn may_carry_attributes(&self) -> bool {
matches!(
self.syntax().parent().map(|it| it.kind()),
Some(SyntaxKind::BLOCK_EXPR | SyntaxKind::EXPR_STMT)
)
}
}
#[derive(Debug, PartialEq, Eq, Clone)]