lang: rename signed integer types sN -> iN
Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.
Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).
Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.
zig build test: 426/426; examples suite: 595/595.
This commit is contained in:
@@ -98,7 +98,7 @@ pub const Value = union(enum) {
|
||||
/// box carries a *Type value* (the `box_any(.., .any)` / `const_type`
|
||||
/// shape) → the TypeId is the payload; otherwise the box carries a
|
||||
/// *runtime value* whose type IS the tag → the tag is the TypeId. This
|
||||
/// makes `type_name(av)` for `av : Any = 6` report `s64` (the held
|
||||
/// makes `type_name(av)` for `av : Any = 6` report `i64` (the held
|
||||
/// value's type) while `type_name(type_of(x))` still names the type.
|
||||
/// Returns null when `self` is neither shape (the caller bails loudly).
|
||||
pub fn reflectTypeId(self: Value) ?TypeId {
|
||||
@@ -266,7 +266,7 @@ pub const Interpreter = struct {
|
||||
const width = self.module.types.typeSizeBytes(val_ty);
|
||||
switch (val) {
|
||||
.int => |v| {
|
||||
// Width is whatever the declared IR type says (s8..s64,
|
||||
// Width is whatever the declared IR type says (i8..i64,
|
||||
// u8..u64, usize, pointer-as-int, bool-after-extension).
|
||||
// The Value tag itself is .int regardless.
|
||||
if (width == 0 or width > 8) return bailDetail("comptime store of int through raw pointer: unexpected declared width (expected 1..8 bytes)");
|
||||
@@ -535,7 +535,7 @@ pub const Interpreter = struct {
|
||||
}
|
||||
return .void_val;
|
||||
}
|
||||
if (ret == .s8 or ret == .s16 or ret == .s32 or ret == .s64 or
|
||||
if (ret == .i8 or ret == .i16 or ret == .i32 or ret == .i64 or
|
||||
ret == .u8 or ret == .u16 or ret == .u32 or ret == .u64 or
|
||||
ret == .usize or ret == .isize)
|
||||
{
|
||||
@@ -1913,7 +1913,7 @@ pub const Interpreter = struct {
|
||||
// Any-boxed Type (`{ .any, tid }`), or an Any holding a
|
||||
// runtime value (`{ tag, value }`, where the tag IS the
|
||||
// value's type). `reflectTypeId` reads the runtime tag so
|
||||
// `type_name(av)` for `av : Any = 6` names `s64`, not the
|
||||
// `type_name(av)` for `av : Any = 6` names `i64`, not the
|
||||
// type whose index equals the payload.
|
||||
const tid = arg.reflectTypeId() orelse
|
||||
return bailDetail("comptime type_name: argument is not a Type value or boxed value (expected `.type_tag` or Any aggregate)");
|
||||
@@ -1939,7 +1939,7 @@ pub const Interpreter = struct {
|
||||
// (`{ tag, value }`, where the tag IS the value's type).
|
||||
// `reflectTypeId` reads the runtime tag so
|
||||
// `type_is_unsigned(av)` for `av : Any = 6` answers about
|
||||
// `s64`, not the type whose index equals the payload.
|
||||
// `i64`, not the type whose index equals the payload.
|
||||
const tid = arg.reflectTypeId() orelse
|
||||
return bailDetail("comptime type_is_unsigned: argument is not a Type value or boxed value (expected `.type_tag` or Any aggregate)");
|
||||
return .{ .value = .{ .boolean = self.module.types.isUnsignedInt(tid) } };
|
||||
|
||||
Reference in New Issue
Block a user