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:
parent
0677aee93f
commit
57b66bdf47
52 changed files with 27005 additions and 11844 deletions
|
|
@ -44,7 +44,7 @@ function sb_putc(s: Sb, c: int) -> void {
|
|||
s.data[s.len] = c
|
||||
s.len += 1
|
||||
}
|
||||
function sb_str(s: Sb) -> pointer {
|
||||
function sb_str(s: Sb) -> string {
|
||||
s.data[s.len] = 0
|
||||
return s.data
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ function strs_sort(a: []pointer) -> void {
|
|||
|
||||
# `<code>` backtick spans: `x` -> <code>x</code> (inner text NOT escaped).
|
||||
# Mirrors codeify's re.sub(r"`([^`]+)`", ...): needs >=1 non-backtick inside.
|
||||
function codeify(s: pointer) -> pointer {
|
||||
function codeify(s: pointer) -> string {
|
||||
let n = slen(s)
|
||||
let b = sb_new()
|
||||
var i = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue