Skip to content

Commit

Permalink
fix boolean in stack
Browse files Browse the repository at this point in the history
  • Loading branch information
xffxff committed Sep 19, 2023
1 parent 4c48dea commit 2d9a5e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions components/lox-execute/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ impl VM {
self.push(a / b);
}
bytecode::Code::True => {
// FIXME: This should be a boolean, not a float.
self.push(1.0);
self.push(true);
},
bytecode::Code::False => {
// FIXME: This should be a boolean, not a float.
self.push(0.0);
self.push(false);
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions lox_tests/boolean.output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Number(
1.0,
Boolean(
true,
)

0 comments on commit 2d9a5e7

Please sign in to comment.