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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user