aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/debug.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-24 18:26:42 +0200
committerBad Diode <bd@badd10de.dev>2021-10-24 18:26:42 +0200
commite2c284b57641b5feec9a8d04313b0cd6d556e860 (patch)
tree3edf7d008f0d68b57727c234a22a0123fe91e383 /src/bytecode/debug.h
parent35f93683d56d8b7f57c3f27fa7085847e2ad4598 (diff)
downloadbdl-e2c284b57641b5feec9a8d04313b0cd6d556e860.tar.gz
bdl-e2c284b57641b5feec9a8d04313b0cd6d556e860.zip
Add lambda type and minor file cleanup
Diffstat (limited to 'src/bytecode/debug.h')
-rwxr-xr-xsrc/bytecode/debug.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bytecode/debug.h b/src/bytecode/debug.h
index 6703e68..7673703 100755
--- a/src/bytecode/debug.h
+++ b/src/bytecode/debug.h
@@ -2,6 +2,7 @@
2#define BDL_DEBUG_H 2#define BDL_DEBUG_H
3 3
4#include "chunk.h" 4#include "chunk.h"
5#include "objects.h"
5 6
6void disassemble_chunk(Chunk *chunk, const char *name); 7void disassemble_chunk(Chunk *chunk, const char *name);
7size_t disassemble_instruction(Chunk *chunk, size_t offset); 8size_t disassemble_instruction(Chunk *chunk, size_t offset);
@@ -51,7 +52,7 @@ disassemble_chunk(Chunk *chunk, const char *name) {
51 offset = 0; 52 offset = 0;
52 while (offset < array_size(chunk->constants)) { 53 while (offset < array_size(chunk->constants)) {
53 printf("\t%03ld -> ", offset); 54 printf("\t%03ld -> ", offset);
54 display(chunk->constants[offset]); 55 object_display(chunk->constants[offset]);
55 printf("\n"); 56 printf("\n");
56 offset++; 57 offset++;
57 } 58 }
@@ -72,7 +73,7 @@ disassemble_instruction(Chunk *chunk, size_t offset) {
72 case OP_CONSTANT: { 73 case OP_CONSTANT: {
73 u8 constant = chunk->code[offset + 1]; 74 u8 constant = chunk->code[offset + 1];
74 printf("%-16s %4d -> ", ops_str[instruction], constant); 75 printf("%-16s %4d -> ", ops_str[instruction], constant);
75 display(chunk->constants[constant]); 76 object_display(chunk->constants[constant]);
76 printf("\n"); 77 printf("\n");
77 return offset + 2; 78 return offset + 2;
78 } break; 79 } break;