Added line numbers to debug and error output.
This commit is contained in:
parent
1958850d87
commit
6b14c2776e
6 changed files with 52 additions and 3 deletions
3
src/vm.h
3
src/vm.h
|
|
@ -32,6 +32,7 @@ static const char *opcode_names[] = {
|
|||
"LOAD_GLOBAL","STORE_GLOBAL","ADD","SUB","MUL","DIV",
|
||||
"LT","LTE","GT","GTE","EQ","NEQ","POP","JUMP",
|
||||
"JUMP_IF_FALSE","CALL","RETURN","PRINT","HALT",
|
||||
"LINE",
|
||||
"MOD","AND","OR","NOT","DUP","SWAP",
|
||||
"MAKE_ARRAY","INDEX_GET","INDEX_SET",
|
||||
"LEN","PUSH","APOP","SET","INSERT","REMOVE","SLICE",
|
||||
|
|
@ -63,6 +64,8 @@ typedef struct {
|
|||
int output_count;
|
||||
|
||||
long long instr_count; // executed instructions in the last vm_run
|
||||
|
||||
int current_line; // last executed source line (debug)
|
||||
} VM;
|
||||
|
||||
// initialize VM (zero state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue