Refactor AssignmentKind to allow backpassing on both let and expect.

The 3rd kind of assignment kind (Bind) is gone and now reflected through a boolean parameter. Note that this parameter is completely erased by the type-checker so that the rest of the pipeline (i.e. code-generation) doesn't have to make any assumption. They simply can't see a backpassing let or expect.
This commit is contained in:
KtorZ
2024-03-10 23:04:07 +01:00
parent df898bf239
commit 435dd0d213
27 changed files with 198 additions and 113 deletions

View File

@@ -4,8 +4,8 @@ use super::{
};
use crate::{
ast::{
AssignmentKind, BinOp, ClauseGuard, Constant, DataTypeKey, FunctionAccessKey, Pattern,
Span, TraceLevel, TypedArg, TypedClause, TypedClauseGuard, TypedDataType, TypedPattern,
BinOp, ClauseGuard, Constant, DataTypeKey, FunctionAccessKey, Pattern, Span, TraceLevel,
TypedArg, TypedAssignmentKind, TypedClause, TypedClauseGuard, TypedDataType, TypedPattern,
UnOp,
},
builtins::{bool, data, function, int, list, void},
@@ -68,7 +68,7 @@ pub enum HoistableFunction {
#[derive(Clone, Debug)]
pub struct AssignmentProperties {
pub value_type: Rc<Type>,
pub kind: AssignmentKind,
pub kind: TypedAssignmentKind,
pub remove_unused: bool,
pub full_check: bool,
pub msg_func: Option<AirMsg>,