mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-02-09 20:20:03 +00:00
Added cosmoV_pushFString(), and cosmoO_pushVFString().
cosmoV_error now pushes the error string onto the stack, as well as uses cosmoO_VFString to format strings. cosmoV_concat is now entirely self contained, and is now stack based. Push the CValues you want to concat into strings onto the stack and call cosmoV_concat with the # of values you pushed.
This commit is contained in:
@@ -52,6 +52,7 @@ static void repl() {
|
||||
cosmoB_loadLibrary(state);
|
||||
cosmoB_loadDebug(state);
|
||||
|
||||
// add our custom REPL functions
|
||||
cosmoV_pushString(state, "quit");
|
||||
cosmoV_pushCFunction(state, cosmoB_quitRepl);
|
||||
|
||||
@@ -111,6 +112,12 @@ static void runFile(const char* fileName) {
|
||||
CState *state = cosmoV_newState();
|
||||
cosmoB_loadLibrary(state);
|
||||
|
||||
// add our input() function to the global table
|
||||
cosmoV_pushString(state, "input");
|
||||
cosmoV_pushCFunction(state, cosmoB_input);
|
||||
|
||||
cosmoV_register(state, 1);
|
||||
|
||||
interpret(state, script, fileName);
|
||||
|
||||
cosmoV_freeState(state);
|
||||
|
||||
Reference in New Issue
Block a user