aboutsummaryrefslogtreecommitdiff
path: root/builtins
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-20 13:06:03 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-20 13:06:03 -0500
commitf9cc44f145dd0c165010765791054666f973eff3 (patch)
tree5a5664797f9bee63a1c3287b3d05d4c20880df97 /builtins
parentd2aeee16e6ad84bfb2d77221e424d1441a2ceea2 (diff)
Fixing up enums
Diffstat (limited to 'builtins')
-rw-r--r--builtins/types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/builtins/types.h b/builtins/types.h
index 7f656b18..253cba84 100644
--- a/builtins/types.h
+++ b/builtins/types.h
@@ -44,6 +44,17 @@ typedef struct TypeInfo {
};
} TypeInfo;
+#define $PointerInfo(sigil_expr, pointed_info) &((TypeInfo){.size=sizeof(void*), .align=__alignof__(void*), \
+ .tag=PointerInfo, .PointerInfo.sigil=sigil_expr, .PointerInfo.pointed=pointed_info})
+#define $ArrayInfo(item_info) &((TypeInfo){.size=sizeof(array_t), .align=__alignof__(array_t), \
+ .tag=ArrayInfo, .ArrayInfo.item=item_info})
+#define $TableInfo(key_expr, value_expr) &((TypeInfo){.size=sizeof(table_t), .align=__alignof__(table_t), \
+ .tag=TableInfo, .TableInfo.key=key_expr, .TableInfo.value=value_expr})
+#define $FunctionInfo(typestr) &((TypeInfo){.size=sizeof(void*), .align=__alignof__(void*), \
+ .tag=FunctionInfo, .FunctionInfo.type_str=typestr})
+#define $TypeInfoInfo(typestr) &((TypeInfo){.size=sizeof(TypeInfo), .align=__alignof__(TypeInfo), \
+ .tag=TypeInfoInfo, .TypeInfoInfo.type_str=typestr})
+
typedef struct {
TypeInfo type;
} TypeInfo_namespace_t;