aboutsummaryrefslogtreecommitdiffstats
path: root/optable.h
diff options
context:
space:
mode:
authordan <[email protected]>2023-05-26 14:59:16 -0400
committerdan <[email protected]>2023-05-26 14:59:16 -0400
commit2b7ea0857da80e1353ce0a72239093f108fdc1e9 (patch)
treebdcfe9a653c94d0385cea58156225149f92dc3ad /optable.h
parent4e26b8c0a1b7fc843741105d57da863997e7284b (diff)
downloadforth-2b7ea0857da80e1353ce0a72239093f108fdc1e9.tar.gz
forth-2b7ea0857da80e1353ce0a72239093f108fdc1e9.tar.bz2
forth-2b7ea0857da80e1353ce0a72239093f108fdc1e9.zip
refactor: if and : moved to optable too
Diffstat (limited to 'optable.h')
-rw-r--r--optable.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/optable.h b/optable.h
index d85ff3d..ebf9a06 100644
--- a/optable.h
+++ b/optable.h
@@ -10,11 +10,19 @@
#define WORD_LEN_LIMIT 255
typedef void (*stackop)(stack *);
+typedef void (*directiveop)(stack *, int len, char* line, int* i);
+
+typedef enum {
+ directive = 0,
+ builtin = 1,
+ script = 2,
+} optype;
typedef struct {
char* word;
- bool isscript;
+ optype optype;
union {
+ directiveop directive;
stackop op;
struct {
char* script;