diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index f47340b..389c7ad 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -89,8 +89,7 @@ fn symbol_table(handle: &mut Schala, input: parsing::AST, comp: Option<&mut Unfi } fn typechecking(handle: &mut Schala, input: parsing::AST, comp: Option<&mut UnfinishedComputation>) -> Result { - /* - match handle.type_context.borrow_mut().type_check_ast(&input) { + match handle.type_context.type_check_ast(&input) { Ok(ty) => { comp.map(|comp| comp.add_artifact(TraceArtifact::new("type_check", format!("{:?}", ty)))); Ok(input) @@ -100,8 +99,6 @@ fn typechecking(handle: &mut Schala, input: parsing::AST, comp: Option<&mut Unfi Ok(input) } } - */ - Ok(input) } fn ast_reducing(_handle: &mut Schala, input: parsing::AST, comp: Option<&mut UnfinishedComputation>) -> Result { diff --git a/schala-lang/src/typechecking.rs b/schala-lang/src/typechecking.rs index 5f02773..64fb071 100644 --- a/schala-lang/src/typechecking.rs +++ b/schala-lang/src/typechecking.rs @@ -139,6 +139,15 @@ impl TypeEnvironment { } } +impl TypeContext { + pub fn type_check_ast(&mut self, ast: &parsing::AST) -> TypeResult { + Ok(format!("SUCKA")) + } +} + + + + /* TODO this should just check the name against a map, and that map should be pre-populated with * types */ /*