conlang: Update type checker

- cl-typeck: Add modules, intrinsic types, unify definition ids
- cl-ast: make attribute lists `Default`
- cl-structures: Add functions to iterate through a pool
- cl-repl: Create an example REPL for the type checker
This commit is contained in:
2024-04-01 05:14:06 -05:00
parent 614d20ea2c
commit 4a52d2bc6a
5 changed files with 862 additions and 75 deletions

View File

@@ -89,6 +89,13 @@ impl<T, ID: InternKey> Pool<T, ID> {
self.pool.get_mut(index.get())
}
pub fn iter(&self) -> impl Iterator<Item = &T> {
self.pool.iter()
}
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T> {
self.pool.iter_mut()
}
pub fn insert(&mut self, value: T) -> ID {
let id = self.pool.len();
self.pool.push(value);