Implement &foo record updater syntax sugar

This commit is contained in:
Sam Mohr 2024-08-16 01:41:59 -07:00
parent a14a110293
commit b1a972ab21
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
22 changed files with 302 additions and 41 deletions

View file

@ -1020,6 +1020,9 @@ pub fn canonicalize_expr<'a>(
ast::Expr::Backpassing(_, _, _) => {
internal_error!("Backpassing should have been desugared by now")
}
ast::Expr::RecordUpdater(_) => {
internal_error!("Record updater should have been desugared by now")
}
ast::Expr::Closure(loc_arg_patterns, loc_body_expr) => {
let (closure_data, output) =
canonicalize_closure(env, var_store, scope, loc_arg_patterns, loc_body_expr, None);
@ -2465,6 +2468,7 @@ pub fn is_valid_interpolation(expr: &ast::Expr<'_>) -> bool {
| ast::Expr::Num(_)
| ast::Expr::NonBase10Int { .. }
| ast::Expr::AccessorFunction(_)
| ast::Expr::RecordUpdater(_)
| ast::Expr::Crash
| ast::Expr::Underscore(_)
| ast::Expr::MalformedIdent(_, _)