Skip to content

Commit

Permalink
Start typing work
Browse files Browse the repository at this point in the history
  • Loading branch information
Amejonah1200 committed Oct 9, 2024
1 parent 3efb365 commit 0bb1b1a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
9 changes: 9 additions & 0 deletions crates/typing/src/checker.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use crate::{ty::TypeId, reg::TypeRegistry};

pub enum UnifyResult {
Success
}

fn unify(reg: TypeRegistry, a: TypeId, b: TypeId) -> UnifyResult {
todo!("unify");
}
5 changes: 4 additions & 1 deletion crates/typing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
pub mod ty;
pub mod ty;
pub mod reg;
pub mod resolver;
pub mod checker;
12 changes: 12 additions & 0 deletions crates/typing/src/reg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use aplang_parser::ast::ParsedType;

use crate::ty::{Type, TypeId};

pub struct TypeRegistry;

impl TypeRegistry {
fn new() -> Self {
TypeRegistry { }
}
}

12 changes: 12 additions & 0 deletions crates/typing/src/resolver.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use aplang_parser::ast::ParsedType;

use crate::ty::TypeId;

pub struct ContextfulTypeResolver;

impl ContextfulTypeResolver {

fn type_id_of(&self, ty: ParsedType) -> TypeId {
todo!("ContextfulTypeResolver::type_id_of")
}
}
2 changes: 1 addition & 1 deletion crates/typing/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ pub enum PrimitiveType {
Boolean,
Unit,
Nothing,
}
}

0 comments on commit 0bb1b1a

Please sign in to comment.