More built-ins.
This commit is contained in:
parent
559400a866
commit
a4f4fcba99
8 changed files with 652 additions and 3 deletions
8
src/vm.h
8
src/vm.h
|
|
@ -17,7 +17,11 @@ static const char *opcode_names[] = {
|
|||
"MOD","AND","OR","NOT","DUP","SWAP",
|
||||
"MAKE_ARRAY","INDEX_GET","INDEX_SET",
|
||||
"LEN","ARR_PUSH","ARR_POP","ARR_SET","ARR_INSERT","ARR_REMOVE","SLICE",
|
||||
"TO_NUMBER","TO_STRING"
|
||||
"TO_NUMBER","TO_STRING",
|
||||
"SPLIT","JOIN","SUBSTR","FIND",
|
||||
"CONTAINS","INDEX_OF","CLEAR",
|
||||
"ENUMERATE","ZIP",
|
||||
"MIN","MAX","CLAMP","ABS","POW","RANDOM_SEED","RANDOM_INT"
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -58,7 +62,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_TO_STRING; // all current opcodes
|
||||
return op >= OP_NOP && op <= OP_RANDOM_INT; // all current opcodes
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue