interpreter: migration to universial stdlib support (without varargs yet)

This commit is contained in:
ProgramSnail 2025-01-20 23:13:42 +03:00
parent 318ebc72aa
commit 58f0bfc0b9
9 changed files with 163 additions and 119 deletions

View file

@ -24,3 +24,5 @@ int32_t mod_load(const char *name, bool do_verification); // < 0 => not found
uint32_t mod_add(Bytefile *module, bool do_verification);
struct ModSearchResult mod_search_pub_symbol(const char *name);
bool run_stdlib_func(const char *name, size_t args_count);

View file

@ -37,11 +37,12 @@ enum class Cmd : int8_t {
LINE,
CALLF,
PATT,
Lread,
Lwrite,
Llength,
Lstring,
Barray,
// NOTE: no longer used
// Lread,
// Lwrite,
// Llength,
// Lstring,
// Barray,
EXIT,
_UNDEF_,
};

View file

@ -117,7 +117,7 @@ enum CMD_TOPLVL {
CMD_ST,
CMD_CTRL,
CMD_PATT,
CMD_BUILTIN,
// CMD_BUILTIN, // NOTE: no longer used
CMD_EXIT = 15,
};
@ -177,10 +177,10 @@ enum CMD_PATTS {
CMD_PATT_FUN_TAG,
};
enum CMD_BUILTINS {
CMD_BUILTIN_Lread = 0,
CMD_BUILTIN_Lwrite,
CMD_BUILTIN_Llength,
CMD_BUILTIN_Lstring,
CMD_BUILTIN_Barray,
};
// enum CMD_BUILTINS { // NOTE: no longer used
// CMD_BUILTIN_Lread = 0,
// CMD_BUILTIN_Lwrite,
// CMD_BUILTIN_Llength,
// CMD_BUILTIN_Lstring,
// CMD_BUILTIN_Barray,
// };