diff options
author | Tom Willemse | 2021-09-06 02:03:31 -0700 |
---|---|---|
committer | Tom Willemse | 2021-09-06 02:03:31 -0700 |
commit | c10cbcdf99824bf81fb0874deb258d5c8c7cb22d (patch) | |
tree | 2872be7d0038f7b0f5a88a2e34875fd856e0101a /clox/src/debug.c | |
parent | 6508cfd8fe55e03a587b2f72d3ffc901d7ada049 (diff) | |
download | crafting-interpreters-c10cbcdf99824bf81fb0874deb258d5c8c7cb22d.tar.gz crafting-interpreters-c10cbcdf99824bf81fb0874deb258d5c8c7cb22d.zip |
Chapter 18
Diffstat (limited to 'clox/src/debug.c')
-rw-r--r-- | clox/src/debug.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clox/src/debug.c b/clox/src/debug.c index 570bde9..788e759 100644 --- a/clox/src/debug.c +++ b/clox/src/debug.c @@ -36,6 +36,18 @@ int disassembleInstruction(Chunk *chunk, int offset) { switch (instruction) { case OP_CONSTANT: return constantInstruction("OP_CONSTANT", chunk, offset); + case OP_NIL: + return simpleInstruction("OP_NIL", offset); + case OP_TRUE: + return simpleInstruction("OP_TRUE", offset); + case OP_FALSE: + return simpleInstruction("OP_FALSE", offset); + case OP_EQUAL: + return simpleInstruction("OP_EQUAL", offset); + case OP_GREATER: + return simpleInstruction("OP_GREATER", offset); + case OP_LESS: + return simpleInstruction("OP_LESS", offset); case OP_ADD: return simpleInstruction("OP_ADD", offset); case OP_SUBTRACT: @@ -44,6 +56,8 @@ int disassembleInstruction(Chunk *chunk, int offset) { return simpleInstruction("OP_MULTIPLY", offset); case OP_DIVIDE: return simpleInstruction("OP_DIVIDE", offset); + case OP_NOT: + return simpleInstruction("OP_NOT", offset); case OP_NEGATE: return simpleInstruction("OP_NEGATE", offset); case OP_RETURN: |