CObjMethod refactor

This commit is contained in:
2020-11-12 23:04:09 -06:00
parent 40ae495aaf
commit 08b6dcbf4c
12 changed files with 135 additions and 65 deletions

View File

@@ -48,7 +48,8 @@ static void repl() {
_ACTIVE = true;
CState *state = cosmoV_newState();
cosmoB_loadlibrary(state);
cosmoB_loadLibrary(state);
cosmoB_loadDebug(state);
// TODO: there's gotta be a better way to do this
cosmoV_register(state, "quit", cosmoV_newObj(cosmoO_newCFunction(state, cosmoB_quitRepl)));
@@ -103,7 +104,7 @@ static char *readFile(const char* path) {
static void runFile(const char* fileName) {
char* script = readFile(fileName);
CState *state = cosmoV_newState();
cosmoB_loadlibrary(state);
cosmoB_loadLibrary(state);
cosmoV_register(state, "input", cosmoV_newObj(cosmoO_newCFunction(state, cosmoB_input)));