Tweaks from repl_tools
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,6 +19,8 @@ bin/
|
||||
*.db
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.dll
|
||||
*.exe
|
||||
*.meta
|
||||
*.log
|
||||
|
||||
2
Toy
2
Toy
Submodule Toy updated: cdca6fa45c...d3df01c1c4
@@ -56,8 +56,8 @@ void Box_initEngine() {
|
||||
Toy_injectNativeHook(&engine.interpreter, "input", Box_hookInput);
|
||||
|
||||
size_t size = 0;
|
||||
const char* source = Toy_readFile("./assets/scripts/init.toy", &size);
|
||||
const unsigned char* tb = Toy_compileString(source, &size);
|
||||
const unsigned char* source = Toy_readFile("./assets/scripts/init.toy", &size);
|
||||
const unsigned char* tb = Toy_compileString((const char*)source, &size);
|
||||
free((void*)source);
|
||||
|
||||
Toy_runInterpreter(&engine.interpreter, tb, size);
|
||||
|
||||
@@ -123,8 +123,8 @@ static int nativeLoadRootNode(Toy_Interpreter* interpreter, Toy_LiteralArray* ar
|
||||
|
||||
//load the new root node
|
||||
size_t size = 0;
|
||||
const char* source = Toy_readFile(Toy_toCString(TOY_AS_STRING(filePathLiteral)), &size);
|
||||
const unsigned char* tb = Toy_compileString(source, &size);
|
||||
const unsigned char* source = Toy_readFile(Toy_toCString(TOY_AS_STRING(filePathLiteral)), &size);
|
||||
const unsigned char* tb = Toy_compileString((const char*)source, &size);
|
||||
free((void*)source);
|
||||
|
||||
engine.rootNode = TOY_ALLOCATE(Box_EngineNode, 1);
|
||||
|
||||
@@ -44,8 +44,8 @@ static int nativeLoadNode(Toy_Interpreter* interpreter, Toy_LiteralArray* argume
|
||||
|
||||
//load the new node
|
||||
size_t size = 0;
|
||||
const char* source = Toy_readFile(Toy_toCString(TOY_AS_STRING(filePathLiteral)), &size);
|
||||
const unsigned char* tb = Toy_compileString(source, &size);
|
||||
const unsigned char* source = Toy_readFile(Toy_toCString(TOY_AS_STRING(filePathLiteral)), &size);
|
||||
const unsigned char* tb = Toy_compileString((const char*)source, &size);
|
||||
free((void*)source);
|
||||
|
||||
Box_EngineNode* node = TOY_ALLOCATE(Box_EngineNode, 1);
|
||||
|
||||
Reference in New Issue
Block a user