aboutsummaryrefslogtreecommitdiff
path: root/vm.d
diff options
context:
space:
mode:
authorBen Winston2023-05-23 18:12:42 -0400
committerBen Winston2023-05-23 18:12:42 -0400
commit6068db6918e2c2c0e34b88014c9ac6d472674e50 (patch)
treeb6e39daa3b1210a822f55e318edfd31b681fefd1 /vm.d
parent5b623d43c5681ed292a0d83a49255f035c40df91 (diff)
more logic, runtime typechecking
Diffstat (limited to 'vm.d')
-rw-r--r--vm.d12
1 files changed, 12 insertions, 0 deletions
diff --git a/vm.d b/vm.d
index ea6a1ae..2f6de06 100644
--- a/vm.d
+++ b/vm.d
@@ -351,6 +351,18 @@ class VM {
double anum = asNumber(a);
pushA(makeNumberValue(anum - bnum));
break;
+ case OpCode.OP_NOT:
+ Value val = popA();
+ bool bval = asBoolean(val);
+ pushA(makeBooleanValue(!bval));
+ break;
+ case OpCode.OP_GREATER:
+ Value b = popA();
+ Value a = popA();
+ double bnum = asNumber(b);
+ double anum = asNumber(a);
+ pushA(makeBooleanValue(anum > bnum));
+ break;
case OpCode.OP_LESS:
Value b = popA();
/*