From 6d724fe372d38eea34ed30d6339cdaafceae1aff Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 13 Jul 2020 10:11:21 -0500 Subject: [PATCH] Small bugfix with cast generation; updated onyx.vim --- misc/onyx.vim | 5 ++++- onyx | Bin 233104 -> 233104 bytes src/onyxwasm.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/misc/onyx.vim b/misc/onyx.vim index 8edffc14..ca189a5e 100644 --- a/misc/onyx.vim +++ b/misc/onyx.vim @@ -16,11 +16,14 @@ syn keyword onyxKeyword for while loop return do syn keyword onyxKeyword break continue return syn keyword onyxKeyword as -syn keyword onyxType unknown bool +syn keyword onyxType unknown bool void +syn keyword onyxType i8 u8 +syn keyword onyxType i16 u16 syn keyword onyxType i32 u32 syn keyword onyxType i64 u64 syn keyword onyxType f32 syn keyword onyxType f64 +syn keyword onyxType rawptr syn keyword onyxConstant true false diff --git a/onyx b/onyx index 81422df31ffb49944d9171dd63d9fb1c0b3413c4..34f7c89e5d0ca9c8614a0ececba1f62a7cbf5ed7 100755 GIT binary patch delta 56 zcmV-80LTB3oeq$l4zSb$6tr1og06k%MSvDbase.type; i32 fromidx = 0, toidx = 0; - if (from->Basic.flags & Basic_Flag_Numeric) { + if (from->Basic.flags & Basic_Flag_Integer) { b32 unsign = (from->Basic.flags & Basic_Flag_Unsigned) != 0; if (from->Basic.size == 4 && !unsign) fromidx = 0; @@ -716,7 +716,7 @@ static void compile_cast(OnyxWasmModule* mod, bh_arr(WasmInstruction)* pcode, As else if (from->Basic.size == 8) fromidx = 5; } - if (to->Basic.flags & Basic_Flag_Numeric) { + if (to->Basic.flags & Basic_Flag_Integer) { b32 unsign = (to->Basic.flags & Basic_Flag_Unsigned) != 0; if (to->Basic.size == 4 && !unsign) toidx = 0; -- 2.25.1