wcc: add the size primitive type (TY_SIZE), classify as unsigned int (#85)

fold-1: type exists + classifies; mirrors TY_UINTPTR at every site, both stages. size(T)/len() return types UNCHANGED (fold-2). Regenerates the 5 combined.ww (lib/ww embedded).
This commit is contained in:
2026-05-26 01:26:03 +09:00
parent 68dbb77d6c
commit bd7181ae1f
7 changed files with 38 additions and 15 deletions

View File

@@ -389,8 +389,11 @@ typedef enum {
TY_UNTYPED_NIL,
/* Appended at the tail to keep existing TY_* values stable —
* lib/ww/typ.ww mirrors them as explicit `def` numbers. */
TY_ENUM /* `enum [storage] { ... }`. sub=storage,
TY_ENUM, /* `enum [storage] { ... }`. sub=storage,
* fields=member list (Tfield.offset = u64 value). */
TY_SIZE /* platform-width unsigned int; mirrors TY_UINTPTR
* (8/8 on amd64). Hare: `size`, SIZE_MAX=U64_MAX
* (ref/hare/types/arch+x86_64.ha:17,20). #85 fold-1. */
} TypeKind;
typedef struct Tfield Tfield;
@@ -436,7 +439,7 @@ struct Type {
extern Type *ty_void, *ty_bool, *ty_rune;
extern Type *ty_i8, *ty_i16, *ty_i32, *ty_i64;
extern Type *ty_u8, *ty_u16, *ty_u32, *ty_u64;
extern Type *ty_int, *ty_uint, *ty_uintptr;
extern Type *ty_int, *ty_uint, *ty_uintptr, *ty_size;
extern Type *ty_f32, *ty_f64, *ty_str;
extern Type *ty_err;
extern Type *ty_never;