Working type checker with functions

This commit is contained in:
2026-04-16 10:03:24 +02:00
parent 819441bc29
commit 3e1fa5cd18
3 changed files with 11 additions and 16 deletions
+2 -14
View File
@@ -11,27 +11,15 @@ pub fn walk_ast(top_scope: Arc<Scope>, tl: &mut Vec<parser::ast::TopLevel>) {
match tl {
parser::ast::TopLevel::Import(_) => unimplemented!(),
parser::ast::TopLevel::FunctionDecl {
export,
name,
params,
return_type,
body,
} => {
parser::ast::TopLevel::FunctionDecl { params, body, .. } => {
let scope = LocalScope::new(top_scope.clone());
scope.with_params(params);
scope.with_block(body);
println!("{:?}", scope);
}
parser::ast::TopLevel::StructDecl {
export,
name,
fields,
} => {}
parser::ast::TopLevel::StructDecl { .. } => {}
}
}
}