Added to_string() and to_number() functions as built-ins.
This commit is contained in:
parent
d67c541824
commit
559400a866
11 changed files with 113 additions and 3 deletions
5
src/vm.h
5
src/vm.h
|
|
@ -16,7 +16,8 @@ static const char *opcode_names[] = {
|
|||
"JUMP_IF_FALSE","CALL","RETURN","PRINT","HALT",
|
||||
"MOD","AND","OR","NOT","DUP","SWAP",
|
||||
"MAKE_ARRAY","INDEX_GET","INDEX_SET",
|
||||
"LEN","ARR_PUSH","ARR_POP","ARR_SET","ARR_INSERT","ARR_REMOVE","SLICE"
|
||||
"LEN","ARR_PUSH","ARR_POP","ARR_SET","ARR_INSERT","ARR_REMOVE","SLICE",
|
||||
"TO_NUMBER","TO_STRING"
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -57,7 +58,7 @@ void vm_dump_globals(VM *vm);
|
|||
void vm_run(VM *vm, Bytecode *entry);
|
||||
|
||||
static inline int opcode_is_valid(int op) {
|
||||
return op >= OP_NOP && op <= OP_SLICE; // all current opcodes
|
||||
return op >= OP_NOP && op <= OP_TO_STRING; // all current opcodes
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue