Updated Toy to 0.7.0

This commit is contained in:
2023-01-13 16:29:56 +00:00
parent ec47adcd9a
commit f5d4b35097
7 changed files with 9 additions and 8 deletions

View File

@@ -10,8 +10,10 @@
//platform exports/imports
#if defined(__linux__)
#define CORE_API extern
#else
#define CORE_API
#endif
#include <assert.h>

View File

@@ -38,7 +38,7 @@ void initEngineNode(EngineNode* node, Interpreter* interpreter, void* tb, size_t
continue;
}
//if this variable is a function
//if this variable is a function (this outmodes import and export)
_entry* entry = &variablesPtr->entries[i];
if (IS_FUNCTION(entry->value)) {
//save a copy

View File

@@ -127,8 +127,6 @@ static int nativeLoadRootNode(Interpreter* interpreter, LiteralArray* arguments)
inner.depth = interpreter->depth + 1;
inner.panic = false;
initLiteralArray(&inner.stack);
inner.exports = interpreter->exports;
inner.exportTypes = interpreter->exportTypes;
inner.hooks = interpreter->hooks;
setInterpreterPrint(&inner, interpreter->printOutput);
setInterpreterAssert(&inner, interpreter->assertOutput);

View File

@@ -51,8 +51,6 @@ static int nativeLoadNode(Interpreter* interpreter, LiteralArray* arguments) {
inner.depth = interpreter->depth + 1;
inner.panic = false;
initLiteralArray(&inner.stack);
inner.exports = interpreter->exports;
inner.exportTypes = interpreter->exportTypes;
inner.hooks = interpreter->hooks;
setInterpreterPrint(&inner, interpreter->printOutput);
setInterpreterAssert(&inner, interpreter->assertOutput);

View File

@@ -1,8 +1,10 @@
#include "lib_standard.h"
#include "toy_common.h"
#include "memory.h"
#include <time.h>
#include <sys/time.h>
static int nativeClock(Interpreter* interpreter, LiteralArray* arguments) {
//no arguments
if (arguments->count != 0) {

View File

@@ -1,9 +1,10 @@
#include "lib_timer.h"
#include "toy_common.h"
#include "memory.h"
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
//GOD DAMN IT: https://stackoverflow.com/questions/15846762/timeval-subtract-explanation
int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y) {