diff options
| author | Ben Winston | 2023-05-22 20:12:40 -0400 |
|---|---|---|
| committer | Ben Winston | 2023-05-22 20:12:40 -0400 |
| commit | b7fba62e9f1f9f7a5a67fd64d4aed55646d1b58e (patch) | |
| tree | 42c192475ed3e17dd57203cab03b41f1cbca40a9 /dbg.d | |
| parent | 229859cde2f0dae4714b972cf18e923027db265c (diff) | |
runtime type checking
Diffstat (limited to 'dbg.d')
| -rw-r--r-- | dbg.d | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -77,6 +77,8 @@ string printableValue(Value val) { } case ValueType.OBJ: return printableFunction(val.as.obj); + case ValueType.TYPE: + return val.as.type; default: return "! unknown value type !"; } @@ -171,7 +173,8 @@ int disassemble(Chunk chunk, int offset) { return jumpInstruction("OP_JUMP_IF_TRUE", 1, chunk, offset); case OpCode.OP_CALL: return byteInstruction("OP_CALL", chunk, offset); - + case OpCode.OP_TYPE_CHECK_NUMBER: + return simpleInstruction("OP_TYPE_CHECK_NUMBER", offset); default: writeln("unknown opcode?"); return offset + 1; |
