aboutsummaryrefslogtreecommitdiff
path: root/src/cffc.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-19 16:45:10 +0200
committerlemon <lsof@mailbox.org>2022-08-19 16:45:10 +0200
commita9e8fe82c8c2e6bf15df0cae861d163f668e9a5a (patch)
treef2207bcf53d4fa107912895bc550262cda7f8596 /src/cffc.hff
parent80f5dca7aa8c9a7f3bf467f9ae2bdc1eae0e9a2b (diff)
change enum backing type
Diffstat (limited to 'src/cffc.hff')
-rw-r--r--src/cffc.hff4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cffc.hff b/src/cffc.hff
index 9fd9080..4563583 100644
--- a/src/cffc.hff
+++ b/src/cffc.hff
@@ -172,7 +172,7 @@ struct Expr {
Slice struct { lhs *Expr, begin *Expr, end *Expr },
Call struct { lhs *Expr, args [#]Expr },
ZeroIni,
- EnumIni struct { name *const u8, val i64 },
+ EnumIni i64,
EUnionIni struct { var *const AggField, ex *Expr },
AggIni struct { flds [#]*const AggField, exs [#]Expr },
ArrIni struct { idxs [#]u32, exs [#]Expr, maxn i64 },
@@ -412,7 +412,7 @@ fn childtype(ty *const Type) *const Type {
}
extern fn completetype(ty *const Type) bool;
fn isnumtype(ty *const Type) bool {
- return ty->is(:Int) or ty->is(:Flo);
+ return ty->is(:Int) or ty->is(:Flo) or (ty->is(:Enum) and ty.u.Enum.lax);
}
extern fn typeof2(a *const Type, b *const Type) *const Type;