feat: Add type checking to the compiler
Introduces the `TypeChecker` struct and its associated `TypeContext` for performing static type analysis on the abstract syntax tree. This change includes: - A new `type_checker.rs` module. - Integration of `TypeChecker` into the `Environment::compile` method. - Updates to `Environment` to manage global types. - Renaming `bound_nodes.rs`'s `BoundNode` to `TypedNode` to reflect its type-checked nature. - Refinements in binder and macro expansion to accommodate type information.
This commit is contained in:
+3
-3
@@ -3,8 +3,7 @@ use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::any::Any;
|
||||
use crate::ast::compiler::bound_nodes::{Address, BoundKind, TypedNode};
|
||||
use crate::ast::nodes::Node;
|
||||
use crate::ast::types::{Value, Object, StaticType};
|
||||
use crate::ast::types::{Value, Object};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Closure {
|
||||
@@ -455,7 +454,8 @@ impl VM {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::ast::types::{SourceLocation, NodeIdentity};
|
||||
use crate::ast::nodes::Node;
|
||||
use crate::ast::types::{SourceLocation, NodeIdentity, StaticType};
|
||||
|
||||
fn make_dummy_identity() -> Rc<NodeIdentity> {
|
||||
Rc::new(NodeIdentity {
|
||||
|
||||
Reference in New Issue
Block a user