diff options
Diffstat (limited to 'clox/src/debug.c')
-rw-r--r-- | clox/src/debug.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clox/src/debug.c b/clox/src/debug.c index 7ba728d..b564aac 100644 --- a/clox/src/debug.c +++ b/clox/src/debug.c @@ -96,6 +96,14 @@ int disassembleInstruction(Chunk *chunk, int offset) { return jumpInstruction("OP_LOOP", -1, chunk, offset); case OP_CALL: return byteInstruction("OP_CALL", chunk, offset); + case OP_CLOSURE: { + offset++; + uint8_t constant = chunk->code[offset++]; + printf("%-16s %4d", "OP_CLOSURE", constant); + printValue(chunk->constants.values[constant]); + printf("\n"); + return offset; + } case OP_RETURN: return simpleInstruction("OP_RETURN", offset); default: |