Skip to content

Commit

Permalink
More small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBrouwer committed Nov 25, 2023
1 parent b21a147 commit c850563
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ cargo run -- input.jj -o output && ./output ; echo $?
# Fixes
* [ ] Updated README, with 3 new colors!
* [ ] Add documentation where necessary.
* [ ] Improve error handling for parsing pass.
* [ ] Improve error handling for type checking pass.
* [x] Improve error handling for parsing pass.
* [x] Improve error handling for type checking pass.
* [ ] Make errors prettier.
* [ ] Improve algorithm for colouring the interference graph.
* [ ] Add read and write functionality to the bencher to update locally.
* [x] Lots, and lots, of refactoring!
* [x] Write test input in comments.

# Upcoming Language Features
* [x] Type inference.
* [x] Implement comments in code.
* [ ] Algebraic Data Types.
* [x] Structs.
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/passes/explicate/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<'p> PrgExplicated<'p> {
let std_iter = self
.std
.iter()
.map(|(_, &def)| dbg!((def, Val::StdlibFunction { sym: def.sym })));
.map(|(_, &def)| (def, Val::StdlibFunction { sym: def.sym }));

self.interpret_tail(
&self.blocks[&self.entry],
Expand Down Expand Up @@ -141,7 +141,7 @@ impl<'p> PrgExplicated<'p> {
}
}
Val::Function { sym } => {
let args = self.fn_params[&dbg!(sym)]
let args = self.fn_params[&sym]
.iter()
.zip(fn_args)
.map(|(param, val)| (param.sym, val));
Expand Down
1 change: 1 addition & 0 deletions compiler/src/passes/validate/partial_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl<'p> PartialType<'p> {
}
}

#[allow(clippy::result_unit_err)]
pub fn combine_partial_types<'p>(
a: PartialType<'p>,
b: PartialType<'p>,
Expand Down
4 changes: 0 additions & 4 deletions compiler/src/utils/union_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ impl<T> UnionFind<T> {
Ok(root)
}

pub fn len(&self) -> usize {
self.data.len()
}

pub fn get(&mut self, index: UnionIndex) -> &T {
let index = self.find(index).0;
&self.data[index]
Expand Down

0 comments on commit c850563

Please sign in to comment.