feat(tazjin/rlox): Implement comparison operators
Change-Id: I03b751db52a3bd502fb4fbda6e89cad087ccad74 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2575 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
This commit is contained in:
parent
c58fe2093e
commit
369f504250
4 changed files with 43 additions and 0 deletions
|
|
@ -91,6 +91,9 @@ impl VM {
|
|||
self.push(Value::Bool(a == b));
|
||||
}
|
||||
|
||||
OpCode::OpLess => binary_op!(self, Number, Bool, <),
|
||||
OpCode::OpGreater => binary_op!(self, Number, Bool, >),
|
||||
|
||||
OpCode::OpNegate => {
|
||||
let v = self.pop();
|
||||
with_type!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue