diff --git a/lib/rivet/src/ast/Table.ri b/lib/rivet/src/ast/Table.ri index bd11f7a04..173bb40a0 100644 --- a/lib/rivet/src/ast/Table.ri +++ b/lib/rivet/src/ast/Table.ri @@ -264,9 +264,9 @@ public struct Table { public func int_bits(self, type: Type) -> uint { type_sym := type.symbol()?; - return if type_sym.info is .Int as int_info { + return if type_sym.info is .SizedInt as int_info { int_info.size - } else if type_sym.info is .Uint as uint_info { + } else if type_sym.info is .SizedUint as uint_info { uint_info.size } else if type_sym.info is .Isize or type_sym.info is .Usize { if self.prefs.target_is_64bit { 64 } else { 32 } @@ -312,14 +312,14 @@ public struct Table { .Alias as alias_info -> self.type_size(alias_info.parent), .Bool -> (1, 1), .Usize, .Isize -> (self.pointer_size, self.pointer_size), - .Int as int -> match int.size { + .SizedInt as int -> match int.size { 8 -> (1, 1), 16 -> (2, 2), 32 -> (4, 4), 64 -> (8, 8), else -> (0, 0) }, - .Uint as uint -> match uint.size { + .SizedUint as uint -> match uint.size { 8 -> (1, 1), 16 -> (2, 2), 32 -> (4, 4), diff --git a/lib/rivet/src/ast/TypeInfo.ri b/lib/rivet/src/ast/TypeInfo.ri index a13262688..d22f51461 100644 --- a/lib/rivet/src/ast/TypeInfo.ri +++ b/lib/rivet/src/ast/TypeInfo.ri @@ -10,10 +10,10 @@ public enum TypeInfo < traits.Stringable { None, Bool, Rune, - Int { + SizedInt { size: uint; }, - Uint { + SizedUint { size: uint; }, Isize, @@ -150,7 +150,7 @@ public enum TypeInfo < traits.Stringable { #[inline] public func is_primitive(self) -> bool { - return self is .Bool or self is .Rune or self is .Int or self is .Uint + return self is .Bool or self is .Rune or self is .SizedInt or self is .Uint or self is .Usize or self is .Isize or self is .ComptimeInt or self is .ComptimeFloat or self is .ComptimeFloat or self is .Float; } @@ -168,9 +168,9 @@ public enum TypeInfo < traits.Stringable { .None -> "none", .Bool -> "bool", .Rune -> "rune", - .Int as int_info -> "int{}".fmt(int_info.size), + .SizedInt as int_info -> "int{}".fmt(int_info.size), .Isize -> "int", - .Uint as uint_info -> "uint{}".fmt(uint_info.size), + .SizedUint as uint_info -> "uint{}".fmt(uint_info.size), .Usize -> "uint", .ComptimeInt -> "comptime_int", .ComptimeFloat -> "comptime_float", diff --git a/lib/rivet/src/codegen/mir/Type.ri b/lib/rivet/src/codegen/mir/Type.ri index 4ad4bd68a..3d0ae4a01 100644 --- a/lib/rivet/src/codegen/mir/Type.ri +++ b/lib/rivet/src/codegen/mir/Type.ri @@ -10,11 +10,11 @@ import std/process; public enum Type < traits.Stringable { Void, Never, - Int { + SizedInt { bits: uint; size: uint; }, - Uint { + SizedUint { bits: uint; size: uint; }, @@ -42,8 +42,8 @@ public enum Type < traits.Stringable { public func size(self) -> uint { return match self is { - .Int as int -> int.size, - .Uint as uint -> uint.size, + .SizedInt as int -> int.size, + .SizedUint as uint -> uint.size, .Basic as basic -> basic.size, .Rawptr as size -> size, .Pointer as ptr -> ptr.size, @@ -57,8 +57,8 @@ public enum Type < traits.Stringable { return match self is { .Void -> "void", .Never -> "never", - .Int as int -> "int{}".fmt(int.bits), - .Uint as uint -> "uint{}".fmt(uint.bits), + .SizedInt as int -> "int{}".fmt(int.bits), + .SizedUint as uint -> "uint{}".fmt(uint.bits), .Basic as basic -> if basic.is_primitive { basic.name } else {