diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-05 14:25:38 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-06 21:57:26 +0200 |
commit | 88099fdaf55a24854508b7a75d690fa76be6f44a (patch) | |
tree | d333186871ec1719bc03319f358583b655da46f2 /lib.h | |
parent | b0153864c0cef2f4ba6202a0242f93d607ccbae9 (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.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |