Start of typechecking and other processing of ast after parsing

This commit is contained in:
2024-12-22 02:53:21 +02:00
parent cb297bf75e
commit f338f07e7d
6 changed files with 169 additions and 96 deletions

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap;
use statement::{Enum, Function, Struct, TypeAlias};
use statement::{Enum, Function, Struct};
use crate::common::loc::LocBox;
use crate::{common::loc::LocBox, validator::predefined::TypeType};
pub use crate::tokeniser::tokentype::*;
pub mod expr;
@@ -13,11 +13,11 @@ pub mod typ;
#[derive(Debug, Clone)]
pub struct Program {
pub ast: expr::Block,
pub structs: HashMap<Ident, Struct>,
pub enums: HashMap<Ident, Enum>,
pub types: HashMap<Ident, TypeAlias>,
pub functions: HashMap<Ident, Function>,
pub member_functions: HashMap<Ident, HashMap<Ident, Function>>,
pub structs: HashMap<Ident, LocBox<Struct>>,
pub enums: HashMap<Ident, LocBox<Enum>>,
pub types: HashMap<Ident, TypeType>,
pub functions: HashMap<Ident, LocBox<Function>>,
pub member_functions: HashMap<Ident, HashMap<Ident, LocBox<Function>>>,
}
#[derive(Debug, Clone)]