From 04fe7ce7f3786d496c79511ff059030835245074 Mon Sep 17 00:00:00 2001 From: IsaacShelton Date: Wed, 6 Nov 2024 23:10:53 -0600 Subject: [PATCH] Refactored resolved callee representation --- src/cli.rs | 1 - src/resolve/mod.rs | 1 - src/resolved/expr/call.rs | 9 ++++++++- src/resolved/mod.rs | 2 ++ src/{resolve => resolved}/polymorph.rs | 0 5 files changed, 10 insertions(+), 3 deletions(-) rename src/{resolve => resolved}/polymorph.rs (100%) diff --git a/src/cli.rs b/src/cli.rs index d99059c..eb1d8a7 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -65,7 +65,6 @@ impl Command { } let Some(filename) = filename else { - // TODO: Implement proper error handling and improve error message eprintln!("error: No folder or filename specified"); return Err(()); }; diff --git a/src/resolve/mod.rs b/src/resolve/mod.rs index a88984f..0ea9118 100644 --- a/src/resolve/mod.rs +++ b/src/resolve/mod.rs @@ -11,7 +11,6 @@ mod global_variable; mod helper_expr; mod initialized; mod job; -mod polymorph; mod stmt; mod type_ctx; mod type_definition; diff --git a/src/resolved/expr/call.rs b/src/resolved/expr/call.rs index 532536e..c4ade0f 100644 --- a/src/resolved/expr/call.rs +++ b/src/resolved/expr/call.rs @@ -1,8 +1,15 @@ use super::TypedExpr; -use crate::resolved::FunctionRef; +use crate::resolved::{FunctionRef, PolyValue}; +use std::collections::HashMap; #[derive(Clone, Debug)] pub struct Call { pub function: FunctionRef, pub arguments: Vec, } + +#[derive(Clone, Debug)] +pub struct Callee { + pub function: FunctionRef, + pub recipe: HashMap, +} diff --git a/src/resolved/mod.rs b/src/resolved/mod.rs index ea580c3..afbfedf 100644 --- a/src/resolved/mod.rs +++ b/src/resolved/mod.rs @@ -8,6 +8,7 @@ mod global; mod helper_expr; mod human_name; mod overload; +mod polymorph; mod stmt; mod structure; mod type_decl; @@ -26,6 +27,7 @@ pub use global::*; pub use helper_expr::*; pub use human_name::*; pub use overload::*; +pub use polymorph::*; use slotmap::{new_key_type, SlotMap}; use std::collections::HashMap; pub use stmt::*; diff --git a/src/resolve/polymorph.rs b/src/resolved/polymorph.rs similarity index 100% rename from src/resolve/polymorph.rs rename to src/resolved/polymorph.rs