1
0
Fork 0
forked from fun/fun

Added new opcode OP_ENV to provide an env() function to get environment variables from your OS.

This commit is contained in:
Johannes Findeisen 2025-09-27 10:06:04 +02:00
commit 4345fc6f0c
6 changed files with 47 additions and 3 deletions

View file

@ -33,7 +33,7 @@ static const char *opcode_names[] = {
"ENUMERATE","ZIP",
"MIN","MAX","CLAMP","ABS","POW","RANDOM_SEED","RANDOM_INT",
"MAKE_MAP","KEYS","VALUES","HAS_KEY",
"READ_FILE","WRITE_FILE"
"READ_FILE","WRITE_FILE","ENV"
};
typedef struct {
@ -76,7 +76,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_WRITE_FILE; // all current opcodes
return op >= OP_NOP && op <= OP_ENV; // all current opcodes
}
#endif