diff --git a/crates/aiken-lang/src/gen_uplc/builder.rs b/crates/aiken-lang/src/gen_uplc/builder.rs index 49304ee5..6c2b0369 100644 --- a/crates/aiken-lang/src/gen_uplc/builder.rs +++ b/crates/aiken-lang/src/gen_uplc/builder.rs @@ -28,46 +28,31 @@ use crate::{ tipo::Type, }; -use super::{ - air::Air, - tree::{AirExpression, AirStatement, AirTree, TreePath}, -}; +use super::tree::{AirExpression, AirStatement, AirTree, TreePath}; + +pub type Variant = String; + +pub type Params = Vec; #[derive(Clone, Debug)] pub enum CodeGenFunction { - Function { body: AirTree, params: Vec }, - Link(String), + Function { body: AirTree, params: Params }, + Link(Variant), } #[derive(Clone, Debug)] pub enum HoistableFunction { Function { body: AirTree, - deps: Vec<(FunctionAccessKey, String)>, - params: Vec, + deps: Vec<(FunctionAccessKey, Variant)>, + params: Params, }, CyclicFunction { - functions: Vec<(Vec, AirTree)>, - deps: Vec<(FunctionAccessKey, String)>, + functions: Vec<(Params, AirTree)>, + deps: Vec<(FunctionAccessKey, Variant)>, }, - Link((FunctionAccessKey, String)), - CyclicLink((FunctionAccessKey, String)), -} - -#[derive(Clone, Debug)] -pub struct FuncComponents { - pub ir: Vec, - pub dependencies: Vec, - pub args: Vec, - pub recursive: bool, - pub defined_by_zero_arg: bool, - pub is_code_gen_func: bool, -} - -#[derive(Clone, Eq, Debug, PartialEq, Hash)] -pub struct ConstrFieldKey { - pub local_var: String, - pub field_name: String, + Link((FunctionAccessKey, Variant)), + CyclicLink((FunctionAccessKey, Variant)), } #[derive(Clone, Debug, Eq, PartialEq, Hash)] @@ -76,8 +61,6 @@ pub struct DataTypeKey { pub defined_type: String, } -pub type ConstrUsageKey = String; - #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct FunctionAccessKey { pub module_name: String,