feat(lang): L4 type checker between parse and emit

selfhost/check/ walks every function, the entry, tests, globals' initializers and
@On listeners with real scopes, and refuses mixed number kinds, text and numbers,
two record types, mismatched slices and fn types, wrong argument counts, wrong
returns and wrong push elements - every mix-up at once, each at its line.
LUDIC_CHECK_REPORT=1 lists them by category. pointer stays untyped (L7's).

What it found is fixed: render3d's HDR scan calling the float-bits extern f_lt
with floats; ludic.shooter's right-stick aim overflowing past half a push;
prof.ludic storing longs in []int; extern arguments now coerced to their
parameters. Text-returning runtime functions say string; Assets.ready says bool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-24 01:34:49 +03:00
parent 0677aee93f
commit 57b66bdf47
52 changed files with 27005 additions and 11844 deletions

View file

@ -235,7 +235,7 @@ function http_ok(h: int) -> bool {
return (st >= 200) and (st < 300)
}
function http_text(h: int) -> pointer {
function http_text(h: int) -> string {
if not http_valid(h) { return null }
return h_body[h - 1]
}
@ -245,7 +245,7 @@ function http_body_len(h: int) -> int {
return h_blen[h - 1]
}
function http_header_of(h: int, name: pointer) -> pointer {
function http_header_of(h: int, name: pointer) -> string {
if not http_valid(h) { return null }
let s = h - 1
if h_native[s] == 1 { return hs_header(s, name) }
@ -332,7 +332,7 @@ function http_parse(resp: pointer, len: int) -> int {
# Look up a header value in a raw header block (case-insensitive), returning a
# fresh NUL-terminated copy, or null if absent. Lines are "Name: value\r\n".
function http_find_header(hdr: pointer, name: pointer) -> pointer {
function http_find_header(hdr: pointer, name: pointer) -> string {
if hdr == null { return null }
let nlen = http_cstr_len(name)
let hlen = http_cstr_len(hdr)