Semantics in check

This commit is contained in:
2026-04-15 09:18:56 +02:00
parent 6717be038f
commit deeb9350b4
3 changed files with 10 additions and 2 deletions
+1
View File
@@ -2,6 +2,7 @@ use std::sync::Arc;
use crate::top_level::TopLevelScope;
#[derive(Clone, Debug)]
pub enum Scope {
TopLevel(TopLevelScope),
}
+5
View File
@@ -4,13 +4,16 @@ use parser::ast::TopLevel;
use parser::ast::{ParamList, TypeExpr};
#[derive(Clone, Debug)]
pub struct TypeSymbol(pub String);
#[derive(Clone, Debug)]
pub struct VarSymbol {
pub var_type: TypeSymbol,
pub name: String,
}
#[derive(Clone, Debug)]
pub struct FunctionSymbol {
pub export: bool,
pub name: String,
@@ -18,6 +21,7 @@ pub struct FunctionSymbol {
pub return_type: Option<TypeSymbol>,
}
#[derive(Clone, Debug)]
pub struct StructSymbol {
pub export: bool,
pub name: String,
@@ -71,6 +75,7 @@ impl StructSymbol {
}
}
#[derive(Clone, Debug)]
pub struct TopLevelScope {
pub structs: HashMap<String, StructSymbol>,
pub functions: HashMap<String, FunctionSymbol>,