make record variable names clearer

This commit is contained in:
Folkert 2020-03-14 01:01:14 +01:00
parent 1a8f380033
commit e62ddc9ef5
5 changed files with 29 additions and 17 deletions

View file

@ -85,7 +85,10 @@ pub enum Expr {
),
// Product Types
Record(Variable, SendMap<Lowercase, Field>),
Record {
record_var: Variable,
fields: SendMap<Lowercase, Field>,
},
/// Empty record constant
EmptyRecord,
@ -195,7 +198,13 @@ pub fn canonicalize_expr<'a>(
} else {
let (can_fields, output) = canonicalize_fields(env, var_store, scope, fields);
(Record(var_store.fresh(), can_fields), output)
(
Record {
record_var: var_store.fresh(),
fields: can_fields,
},
output,
)
}
}
ast::Expr::Str(string) => (Str((*string).into()), Output::default()),