diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-24 20:20:06 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-24 20:20:06 +0100 |
commit | e9b99a90510309ac4f5d91d4a5138e7a84904057 (patch) | |
tree | 9d633feb897bcbbd43da6419882df600f9de5595 /dis.c | |
parent | bc47478d855b08023409dbfc8550958991265c14 (diff) |
add local variables and (let) form
Diffstat (limited to 'dis.c')
-rw-r--r-- | dis.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |