code wiki / _hdl_build / nx_nishilang_norm.nx
nx_nishilang_norm.nx
buildroot/runtime/_hdl_build/nx_nishilang_norm.nx
about
nx_nishilang_norm.nx -- THE GENERAL-MODEL BRIDGE (autonomous-builder lane, 2026-07-20).
The maker-climb root cause (NB7): a strong GENERAL coder (Qwen-class, coder15) emits `else if` /
`else` blocks that NishiLang has no keyword for -> build breaks. This normalizer rewrites those
into valid NishiLang EARLY-RETURN form so any off-the-shelf coder's output compiles. SOUND by
construction of the loop: the transform is only a SYNTAX rewrite; the symbolic judge (nx_symjudge)
then property-verifies the normalized fix over an exhaustive sweep, so a mis-normalization is
caught (fail-closed) -- never a silent wrong fix. Rewrites (semantics-preserving for return-bodies):
`} else if C {` -> `} if C {` (else-if chain -> separate early-return ifs)
`} else { E }` -> `} E ` (strip the else wrapper + its matching close brace)
argv: <infile> <outfile> (reads generated-fix text, writes normalized NishiLang)
exit: 0 wrote | 2 io. Idempotent (already-valid NishiLang passes through byte-unchanged).
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_seg_store.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 16 | const NN_CAP: i64 = 262144 |
| 17 | const NN_MAXPEND: i64 = 64 |
| 18 | const NN_LB: i64 = 123 // |
| 19 | const NN_RB: i64 = 125 // } |
functions
| 21 | func nn_starts(b: *u8, i: i64, n: i64, s: *u8) -> i64 called by 1: nn_normalize |
| 32 | func nn_normalize(src: *u8, n: i64, out: *u8) -> i64 |
| 80 | func main(argc: i64, argv: *i64) -> i64 |