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:
Vincent Ambo 2021-02-28 16:00:01 +02:00 committed by tazjin
parent c58fe2093e
commit 369f504250
4 changed files with 43 additions and 0 deletions

View file

@ -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!(