From: Brendan Hansen Date: Mon, 13 Jul 2020 15:11:21 +0000 (-0500) Subject: Small bugfix with cast generation; updated onyx.vim X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=6d724fe372d38eea34ed30d6339cdaafceae1aff;p=onyx.git Small bugfix with cast generation; updated onyx.vim --- 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 81422df3..34f7c89e 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxwasm.c b/src/onyxwasm.c index 9eb365a0..bac645d3 100644 --- a/src/onyxwasm.c +++ b/src/onyxwasm.c @@ -703,7 +703,7 @@ static void compile_cast(OnyxWasmModule* mod, bh_arr(WasmInstruction)* pcode, As Type* to = cast->base.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;