mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-01-02 13:50:18 +00:00
Added optional os.* library, fixed cosmoB_loadLibrary
- os.time() returns the UNIX Epoch time in seconds - os.read() reads file and returns the data as a <string> object
This commit is contained in:
@@ -52,6 +52,7 @@ static void repl() {
|
||||
|
||||
CState *state = cosmoV_newState();
|
||||
cosmoB_loadLibrary(state);
|
||||
cosmoB_loadOSLib(state);
|
||||
cosmoB_loadVM(state);
|
||||
|
||||
// add our custom REPL functions
|
||||
@@ -113,6 +114,7 @@ static void runFile(const char* fileName) {
|
||||
char* script = readFile(fileName);
|
||||
CState *state = cosmoV_newState();
|
||||
cosmoB_loadLibrary(state);
|
||||
cosmoB_loadOSLib(state);
|
||||
|
||||
// add our input() function to the global table
|
||||
cosmoV_pushString(state, "input");
|
||||
|
||||
Reference in New Issue
Block a user