1
0
Fork 0
forked from fun/fun

More built-ins.

This commit is contained in:
Johannes Findeisen 2025-09-15 03:59:03 +02:00
commit a4f4fcba99
8 changed files with 652 additions and 3 deletions

View file

@ -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