1
0
Fork 0
forked from fun/fun

Added fun_version and env_all as opcodes and some fixes in httpserver. (0.37.30)

This commit is contained in:
Johannes Findeisen 2025-12-28 23:36:37 +01:00
commit a27ff12b08
12 changed files with 126 additions and 6 deletions

View file

@ -757,6 +757,20 @@ static int emit_primary(Bytecode *bc, const char *src, size_t len, size_t *pos)
free(name);
return 1;
}
if (strcmp(name, "env_all") == 0) {
(*pos)++; /* '(' */
if (!consume_char(src, len, pos, ')')) { parser_fail(*pos, "env_all expects ()"); free(name); return 0; }
bytecode_add_instruction(bc, OP_ENV_ALL, 0);
free(name);
return 1;
}
if (strcmp(name, "fun_version") == 0) {
(*pos)++; /* '(' */
if (!consume_char(src, len, pos, ')')) { parser_fail(*pos, "fun_version expects ()"); free(name); return 0; }
bytecode_add_instruction(bc, OP_FUN_VERSION, 0);
free(name);
return 1;
}
if (strcmp(name, "os_list_dir") == 0) {
(*pos)++; /* '(' */
if (!emit_expression(bc, src, len, pos)) { parser_fail(*pos, "os_list_dir expects (path)"); free(name); return 0; }