Native functions are working

This commit is contained in:
2022-08-27 15:39:42 +01:00
parent e523a6f60a
commit ec91bac8a5
12 changed files with 492 additions and 34 deletions

View File

@@ -29,6 +29,12 @@ typedef struct Interpreter {
bool panic;
} Interpreter;
//for native function API
typedef int (*NativeFn)(Interpreter* interpreter, LiteralArray* arguments);
bool injectNativeFn(Interpreter* interpreter, char* name, NativeFn func);
bool parseIdentifierToValue(Interpreter* interpreter, Literal* literalPtr);
//init & free
void initInterpreter(Interpreter* interpreter);
void freeInterpreter(Interpreter* interpreter);