about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-02-28T14·00+0200
committertazjin <mail@tazj.in>2021-02-28T14·36+0000
commit369f504250fe6508d3b927c6c8320a2525edfad1 (patch)
treed9df01a16a3a96a95f9089ccff96a8d5fae6b129 /users/tazjin/rlox/src/bytecode/vm.rs
parentc58fe2093e2a2870fc76ea55aa2de8e5aa6dab7d (diff)
feat(tazjin/rlox): Implement comparison operators r/2256
Change-Id: I03b751db52a3bd502fb4fbda6e89cad087ccad74
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2575
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/vm.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/vm.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/vm.rs b/users/tazjin/rlox/src/bytecode/vm.rs
index 0b24dc46cdb9..634d4eced146 100644
--- a/users/tazjin/rlox/src/bytecode/vm.rs
+++ b/users/tazjin/rlox/src/bytecode/vm.rs
@@ -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!(