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:
agra
2026-06-12 09:31:53 +03:00
parent 515ecebea7
commit d8076b9333
1054 changed files with 6836 additions and 6839 deletions

View File

@@ -28,14 +28,14 @@ pub const GenericResolver = struct {
// ── Mono-key construction ───────────────────────────────────────────
/// Mangle a TypeId into its mono-key fragment ("s64", "ptr_T", "SL_T",
/// Mangle a TypeId into its mono-key fragment ("i64", "ptr_T", "SL_T",
/// "AR_n_T", struct name, "tu_X_Y", …). Recursive for compound shapes.
pub fn mangleTypeName(self: GenericResolver, ty: TypeId) []const u8 {
// Builtin types
if (ty == .s8) return "s8";
if (ty == .s16) return "s16";
if (ty == .s32) return "s32";
if (ty == .s64) return "s64";
if (ty == .i8) return "i8";
if (ty == .i16) return "i16";
if (ty == .i32) return "i32";
if (ty == .i64) return "i64";
if (ty == .u8) return "u8";
if (ty == .u16) return "u16";
if (ty == .u32) return "u32";
@@ -77,7 +77,7 @@ pub const GenericResolver = struct {
const inner = self.mangleTypeName(a.element);
break :blk std.fmt.allocPrint(self.l.alloc, "AR_{d}_{s}", .{ a.length, inner }) catch "array";
},
.signed => |w| std.fmt.allocPrint(self.l.alloc, "s{d}", .{w}) catch "signed",
.signed => |w| std.fmt.allocPrint(self.l.alloc, "i{d}", .{w}) catch "signed",
.unsigned => |w| std.fmt.allocPrint(self.l.alloc, "u{d}", .{w}) catch "unsigned",
.optional => |o| blk: {
const inner = self.mangleTypeName(o.child);
@@ -277,10 +277,10 @@ pub const GenericResolver = struct {
// empty `tmp_bindings` is a valid input — non-generic literal
// return types (e.g. `walk(..$args) -> string`) still need to
// resolve through `resolveTypeWithBindings`, not fall through
// to the historical `.s64` default. The default silently
// to the historical `.i64` default. The default silently
// misclassified pack-fn calls whose return type was a fixed
// literal — every consumer (e.g. print's pack-shape mangling)
// inferred `s64` and routed the value through the wrong Any
// inferred `i64` and routed the value through the wrong Any
// tag.
var scope = TypeBindingScope.enter(self.l, tmp_bindings);
defer scope.exit();