Desugar idents ending in ! to TrySuffix

This commit is contained in:
Agus Zubiaga 2024-10-14 21:39:45 -03:00
parent 56cdc749af
commit aeeaab4b99
No known key found for this signature in database
9 changed files with 62 additions and 38 deletions

View file

@ -591,7 +591,13 @@ pub fn is_top_level_suffixed(expr: &Expr) -> bool {
pub fn is_expr_suffixed(expr: &Expr) -> bool {
match expr {
// expression without arguments, `read!`
Expr::Var { .. } => false,
Expr::Var {
module_name: _,
ident,
} => {
// TODO remove when purity inference fully replaces Task
ident.ends_with('!')
}
Expr::TrySuffix { .. } => true,