aboutsummaryrefslogtreecommitdiff
path: root/src/fold.cff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-31 16:00:34 +0200
committerlemon <lsof@mailbox.org>2022-08-31 16:00:34 +0200
commitb4310d08333fcb9ae4f3e4bf1e0e5fc6599ada4e (patch)
tree6b38da06b027db62bd4ab21f6241282b904435d3 /src/fold.cff
parent047a978be814f0ff46482689ef60582061a5c08b (diff)
def x = expr -> defmacro x = expr, def const -> def
Diffstat (limited to 'src/fold.cff')
-rw-r--r--src/fold.cff6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fold.cff b/src/fold.cff
index 8814d32..be08256 100644
--- a/src/fold.cff
+++ b/src/fold.cff
@@ -24,16 +24,18 @@ fn numcast(ex *Expr, to *const Type) void {
*f = *f;
case from->is(:Bool);
iu.i = *b ? 1 : 0;
- case from->is(:Int) and to == ty_u8;
+ case from->is(:Int) and to == ty_i8;
iu.i = as(i8)iu.i;
case from->is(:Int) and to == ty_u8;
iu.i = as(u8)iu.i;
case from->is(:Int) and to == ty_i16;
iu.i = as(i16)iu.i;
case from->is(:Int) and to == ty_u16;
- iu.i = as(u8)iu.i;
+ iu.i = as(u16)iu.i;
case from->is(:Int) and to == ty_i32;
iu.i = as(i32)iu.i;
+ case from->is(:Int) and to == ty_u32;
+ iu.i = as(u32)iu.i;
case from->is(:Int) and to == ty_i64;
iu.i = as(i64)iu.i;
case from->is(:Int) and to == ty_u64;