Resolved #45, Exports region removed

This commit is contained in:
2023-01-13 16:12:44 +00:00
parent 0649a141dd
commit 3498baad9b
12 changed files with 23 additions and 296 deletions

View File

@@ -186,7 +186,6 @@ int main() {
"dot-chaining.toy",
"dottify-bugfix.toy",
"functions.toy",
"imports-and-exports.toy",
"index-arrays.toy",
"index-dictionaries.toy",
"index-strings.toy",
@@ -212,38 +211,6 @@ int main() {
}
}
{
//read source
size_t dummy;
size_t exportSize, importSize;
char* exportSource = readFile("scripts/separate-exports.toy", &dummy);
char* importSource = readFile("scripts/separate-imports.toy", &dummy);
//compile
unsigned char* exportBinary = compileString(exportSource, &exportSize);
unsigned char* importBinary = compileString(importSource, &importSize);
//run the interpreter over both binaries
Interpreter interpreter;
initInterpreter(&interpreter);
//NOTE: supress print output for testing
setInterpreterPrint(&interpreter, noPrintFn);
setInterpreterAssert(&interpreter, noAssertFn);
runInterpreter(&interpreter, exportBinary, exportSize); //automatically frees the binary data
resetInterpreter(&interpreter);
runInterpreter(&interpreter, importBinary, importSize); //automatically frees the binary data
freeInterpreter(&interpreter);
//cleanup
free((void*)exportSource);
free((void*)importSource);
}
//1, to allow for the assertion test
if (ignoredAssertions > 1) {
fprintf(stderr, ERROR "Assertions hidden: %d\n", ignoredAssertions);