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

@@ -127,7 +127,7 @@ pub fn processCImport(
.name = pname,
.name_span = .{ .start = 0, .end = 0 },
.type_expr = ptype_node,
// Foreign C param names (`s1`, `s2`, …) are RAW — exempt from
// Foreign C param names (`i1`, `i2`, …) are RAW — exempt from
// the reserved-type-name binding check; generated bindings
// must import without hand-edits.
.is_raw = true,
@@ -157,7 +157,7 @@ pub fn processCImport(
.return_type = ret_node,
.body = foreign_body,
// A foreign C function whose own NAME collides with a reserved
// type spelling (`int s2(int);`) is RAW — exempt from the
// type spelling (`int i2(int);`) is RAW — exempt from the
// reserved-type-name decl check so generated bindings import
// without hand-edits.
.is_raw = true,
@@ -505,9 +505,9 @@ fn mapCTypeToSxNode(
if (std.mem.eql(u8, base, "void") or std.mem.eql(u8, base, "const void")) {
return makePointerTypeNode(allocator, "void");
}
// int * → *s32
// int * → *i32
if (std.mem.eql(u8, base, "int") or std.mem.eql(u8, base, "const int")) {
return makePointerTypeNode(allocator, "s32");
return makePointerTypeNode(allocator, "i32");
}
// unsigned int * / unsigned * → *u32
if (std.mem.eql(u8, base, "unsigned int") or std.mem.eql(u8, base, "unsigned") or std.mem.eql(u8, base, "const unsigned int")) {
@@ -521,9 +521,9 @@ fn mapCTypeToSxNode(
if (std.mem.eql(u8, base, "double") or std.mem.eql(u8, base, "const double")) {
return makePointerTypeNode(allocator, "f64");
}
// short * → *s16
// short * → *i16
if (std.mem.eql(u8, base, "short") or std.mem.eql(u8, base, "const short")) {
return makePointerTypeNode(allocator, "s16");
return makePointerTypeNode(allocator, "i16");
}
// Pointer to pointer → *void
if (std.mem.endsWith(u8, base, "*")) {
@@ -539,13 +539,13 @@ fn mapCTypeToSxNode(
}
// Direct types
if (std.mem.eql(u8, trimmed, "int") or std.mem.eql(u8, trimmed, "signed int")) return makeTypeExprNode(allocator, "s32");
if (std.mem.eql(u8, trimmed, "int") or std.mem.eql(u8, trimmed, "signed int")) return makeTypeExprNode(allocator, "i32");
if (std.mem.eql(u8, trimmed, "unsigned int") or std.mem.eql(u8, trimmed, "unsigned")) return makeTypeExprNode(allocator, "u32");
if (std.mem.eql(u8, trimmed, "long") or std.mem.eql(u8, trimmed, "long int") or std.mem.eql(u8, trimmed, "signed long")) return makeTypeExprNode(allocator, "s64");
if (std.mem.eql(u8, trimmed, "long") or std.mem.eql(u8, trimmed, "long int") or std.mem.eql(u8, trimmed, "signed long")) return makeTypeExprNode(allocator, "i64");
if (std.mem.eql(u8, trimmed, "unsigned long") or std.mem.eql(u8, trimmed, "unsigned long int")) return makeTypeExprNode(allocator, "u64");
if (std.mem.eql(u8, trimmed, "long long") or std.mem.eql(u8, trimmed, "long long int")) return makeTypeExprNode(allocator, "s64");
if (std.mem.eql(u8, trimmed, "long long") or std.mem.eql(u8, trimmed, "long long int")) return makeTypeExprNode(allocator, "i64");
if (std.mem.eql(u8, trimmed, "unsigned long long") or std.mem.eql(u8, trimmed, "unsigned long long int")) return makeTypeExprNode(allocator, "u64");
if (std.mem.eql(u8, trimmed, "short") or std.mem.eql(u8, trimmed, "short int") or std.mem.eql(u8, trimmed, "signed short")) return makeTypeExprNode(allocator, "s16");
if (std.mem.eql(u8, trimmed, "short") or std.mem.eql(u8, trimmed, "short int") or std.mem.eql(u8, trimmed, "signed short")) return makeTypeExprNode(allocator, "i16");
if (std.mem.eql(u8, trimmed, "unsigned short") or std.mem.eql(u8, trimmed, "unsigned short int")) return makeTypeExprNode(allocator, "u16");
if (std.mem.eql(u8, trimmed, "char") or std.mem.eql(u8, trimmed, "signed char")) return makeTypeExprNode(allocator, "u8");
if (std.mem.eql(u8, trimmed, "unsigned char")) return makeTypeExprNode(allocator, "u8");
@@ -554,8 +554,8 @@ fn mapCTypeToSxNode(
if (std.mem.eql(u8, trimmed, "size_t")) return makeTypeExprNode(allocator, "u64");
if (std.mem.eql(u8, trimmed, "_Bool") or std.mem.eql(u8, trimmed, "bool")) return makeTypeExprNode(allocator, "u8");
// Default: unknown type → s64 (treat as opaque integer-sized value)
return makeTypeExprNode(allocator, "s64");
// Default: unknown type → i64 (treat as opaque integer-sized value)
return makeTypeExprNode(allocator, "i64");
}
// ---------------------------------------------------------------------------