From c2138b3ba1d49ff93bdebe9b76aca7c356b46689 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 29 May 2023 15:26:26 -0400 Subject: feat: add jit-compiled optype ; add more new commands --- optable.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'optable.h') diff --git a/optable.h b/optable.h index b55b38e..e84ad31 100644 --- a/optable.h +++ b/optable.h @@ -12,10 +12,19 @@ typedef void (*stackop)(stack *); typedef void (*directiveop)(stack *, int len, char* line, int* i); +typedef struct { + bool isliteral; + union { + stackop stackop; + stackitem literal; + }; +} compileditem; + typedef enum { directive = 0, builtin = 1, script = 2, + compiled = 3, } optype; typedef struct { @@ -28,6 +37,10 @@ typedef struct { char* script; int scriptlen; }; + struct { + compileditem* oplist; + int oplistlen; + }; }; } wordop; @@ -37,4 +50,6 @@ typedef struct { */ wordop* getop(char *word); +void optable_init(); + #endif //OPTABLE_H -- cgit v1.2.3