From 7ce90478f0045d3a2af97527f0962c6b808842a8 Mon Sep 17 00:00:00 2001 From: Selimaj Dev Date: Wed, 15 Apr 2026 10:56:39 +0200 Subject: [PATCH] working hir --- semantic/src/hir.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/semantic/src/hir.rs b/semantic/src/hir.rs index e1b2a7c..f22e58c 100644 --- a/semantic/src/hir.rs +++ b/semantic/src/hir.rs @@ -5,6 +5,7 @@ use crate::top_level::{FunctionSymbol, StructSymbol, TopLevelSymbolScope, TypeSy #[derive(Clone, Debug)] pub enum TypeRef { Struct(StructRef), + Int, } #[derive(Clone, Debug)] @@ -61,7 +62,7 @@ impl TopLevelHirScope { if let Some(rf) = self.functions.get(&symbol.name) { rf.clone() } else { - if let Some(tlss_rf) = tlss.functions.get(&symbol.name) { + if let Some(_) = tlss.functions.get(&symbol.name) { let rf = Arc::new(FunctionRef { export: symbol.export, name: symbol.name.clone(), @@ -141,7 +142,19 @@ impl TopLevelHirScope { rf } else { - unimplemented!() + match symbol.0.as_str() { + "int" => { + let rf = Arc::new(TypeRef::Int); + + self.types.insert(symbol.0.clone(), rf.clone()); + + rf + } + + _ => { + unimplemented!("{:?}", symbol) + } + } } } }