Added MSVC debugging tool, discovered globals feature
This commit is contained in:
@@ -24,12 +24,15 @@
|
||||
#include <SDL_image.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#ifndef BOX_EXPORT
|
||||
#define BOX_API __declspec(dllimport)
|
||||
#else
|
||||
#define BOX_API __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
//TODO: figure out the sleep issue
|
||||
#define sleep Sleep
|
||||
|
||||
#else
|
||||
|
||||
@@ -70,7 +70,7 @@ void Box_initEngine() {
|
||||
const unsigned char* tb = Toy_compileString((const char*)source, &size);
|
||||
free((void*)source);
|
||||
|
||||
//TODO: inner-interpreter
|
||||
//A quirk of the setup is that anything defined in `init.toy` becomes a global object
|
||||
Toy_runInterpreter(&engine.interpreter, tb, size);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ static void execLoadRootNode() {
|
||||
Box_callEngineNode(engine.rootNode, &inner, "onLoad", NULL);
|
||||
|
||||
//manual cleanup
|
||||
inner.scope = Toy_popScope(inner.scope);
|
||||
Toy_popScope(inner.scope);
|
||||
Toy_freeLiteralArray(&inner.stack);
|
||||
Toy_freeLiteralArray(&inner.literalCache);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user