summaryrefslogtreecommitdiffhomepage
path: root/lib.h
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-05 14:25:38 +0200
committerJo-Philipp Wich <jo@mein.io>2020-09-06 21:57:26 +0200
commit88099fdaf55a24854508b7a75d690fa76be6f44a (patch)
treed333186871ec1719bc03319f358583b655da46f2 /lib.h
parentb0153864c0cef2f4ba6202a0242f93d607ccbae9 (diff)
treewide: refactor internal AST structures
- unify operand and value tag structures - use a contiguous array for storing opcodes - use relative offsets for next and children ops - defer function creation to runtime - rework "this" context handling by storing context pointer in scope tags Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index 512a558..9471141 100644
--- a/lib.h
+++ b/lib.h
@@ -20,7 +20,11 @@
#include "ast.h"
#include "lexer.h"
-typedef struct json_object *(ut_c_fn)(struct ut_state *, struct ut_opcode *, struct json_object *);
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+#endif
+
+typedef struct json_object *(ut_c_fn)(struct ut_state *, uint32_t, struct json_object *);
void ut_lib_init(struct ut_state *state, struct json_object *scope);