Variables now persist between statements

This commit is contained in:
2022-08-13 21:27:39 +01:00
parent 633df5f376
commit e9ab6f3f96
5 changed files with 34 additions and 18 deletions

View File

@@ -21,16 +21,16 @@ typedef struct Interpreter {
LiteralArray stack;
//output
// LiteralDictionary exports; //read-write - interface with Toy from C
// LiteralDictionary exports; //TODO: read-write - interface with Toy from C
PrintFn printOutput;
PrintFn assertOutput;
} Interpreter;
void initInterpreter(Interpreter* interpreter, unsigned char* bytecode, int length);
void initInterpreter(Interpreter* interpreter);
void freeInterpreter(Interpreter* interpreter);
//utilities for the host program
void setInterpreterPrint(Interpreter* interpreter, PrintFn printOutput);
void setInterpreterAssert(Interpreter* interpreter, PrintFn assertOutput);
void runInterpreter(Interpreter* interpreter);
void runInterpreter(Interpreter* interpreter, unsigned char* bytecode, int length);