aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ek/ast.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ek/ast.h b/include/ek/ast.h
index 3d839ad..53bc8d6 100644
--- a/include/ek/ast.h
+++ b/include/ek/ast.h
@@ -158,6 +158,7 @@ enum ast_kind {
AST_CONST_CHAR,
AST_CONST_BOOL,
AST_CONST_STR,
+ AST_UNPACK,
};
/** Flags an AST node can have. */
@@ -275,6 +276,9 @@ size_t type_offsetof(struct type *t, char *m);
#define tgen_trait(id, def, loc) \
tgen_type(TYPE_TRAIT, NULL, NULL, def, NULL, id, loc)
+#define tgen_enum(id, def, loc) \
+ tgen_type(TYPE_ENUM, NULL, NULL, def, NULL, id, loc)
+
static inline bool is_binop(struct ast *x)
{
switch (x->k) {
@@ -625,6 +629,9 @@ static inline bool is_primitive(struct type *t)
#define gen_id(id, loc) \
gen_str(AST_ID, id, loc)
+#define gen_unpack(id, loc) \
+ gen_str(AST_UNPACK, id, loc)
+
#define gen_empty(loc) \
gen1(AST_EMPTY, NULL, loc)