removed 'roots', replaced with a registry table

- removed cosmoM_addRoot
- removed cosmoM_removeRoot
- renamed cosmoV_register to cosmoV_addGlobals
- added cosmoV_addRegistry
- added cosmoV_getRegistry
- added cosmoV_setProto
- added cosmoV_isValueUserType
This commit is contained in:
2023-09-05 14:35:29 -05:00
committed by cpunch
parent 6701a63a63
commit bf36412699
9 changed files with 121 additions and 93 deletions

4
main.c
View File

@@ -75,7 +75,7 @@ static void repl(CState *state)
cosmoV_pushString(state, "input");
cosmoV_pushCFunction(state, cosmoB_input);
cosmoV_register(state, 2);
cosmoV_addGlobals(state, 2);
while (_ACTIVE) {
if (!(line = linenoise("> "))) { // better than gets()
@@ -130,7 +130,7 @@ static bool runFile(CState *state, const char *fileName)
cosmoV_pushString(state, "input");
cosmoV_pushCFunction(state, cosmoB_input);
cosmoV_register(state, 1);
cosmoV_addGlobals(state, 1);
ret = interpret(state, script, fileName);