summaryrefslogtreecommitdiff
path: root/dis.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-24 20:20:06 +0100
committerubq323 <ubq323@ubq323.website>2024-06-24 20:20:06 +0100
commite9b99a90510309ac4f5d91d4a5138e7a84904057 (patch)
tree9d633feb897bcbbd43da6419882df600f9de5595 /dis.c
parentbc47478d855b08023409dbfc8550958991265c14 (diff)
add local variables and (let) form
Diffstat (limited to 'dis.c')
-rw-r--r--dis.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dis.c b/dis.c
index 0b1d322..6827be0 100644
--- a/dis.c
+++ b/dis.c
@@ -39,6 +39,11 @@ static size_t disasm_instr_h(Chunk *ch, size_t ip, int depth) {
print_const(ch, ix);
break;
}
+ case OP_GETLOCAL: {
+ uint8_t ix = ch->bc.d[ip++];
+ printf("getlocal #%d\n",ix);
+ break;
+ }
case OP_SETGLOBAL: {
uint8_t ix = ch->bc.d[ip++];
printf("setglobal #%d\t; ",ix);
@@ -50,6 +55,11 @@ static size_t disasm_instr_h(Chunk *ch, size_t ip, int depth) {
printf("call #%hhu\n",nargs);
break;
}
+ case OP_ENDSCOPE: {
+ uint8_t nlocals = ch->bc.d[ip++];
+ printf("endscope #%hhu\n",nlocals);
+ break;
+ }
#define RSHORT() (uint16_t)( ch->bc.d[ip-2] | ch->bc.d[ip-1] << 8 )
case OP_SKIP: {
ip += 2;