code wiki / _hdl_build / nx_lang_lint.nx

nx_lang_lint.nx

buildroot/runtime/_hdl_build/nx_lang_lint.nx

5510 B105 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic lang
docsdependenciesstructsconstsfunctions

about

nx_lang_lint.nx -- the NISHI-LANG SELF-IMPROVEMENT linter (operator: identify AND address the language gaps so nx becomes an ever-improving RSI loop -- from the bits up). This is the IDENTIFY half: scan a .nx source for the KNOWN landmine patterns (the landmines.tsv ergonomic class) and flag them BEFORE they reach nxasm and turn into silent rc=6 / miscompiles. A caught-at-lint landmine is a language defect made visible -- the first step to retiring it as a real feature (X-LANG-004). Patterns detected (each a documented landmine): L1 ANDOR "&&" or "||" -- unsupported operators (must be nested ifs) L2 EMPTYSTR "" empty-string lit -- the no-empty-string-literal landmine L3 BIGARGS func with >6 params -- the <=6-args calling-convention landmine L4 FNHEAVY >=18 calls "name(" in one func -- approaching the 21-call rc=6 cliff Durable: LINT-HIT rows + LINT verdict -> knowledge/status/lang_lint.log. Exit 0 = clean; 1 = landmines found (the source needs the workaround OR the lang needs the feature). argv[1]=source path. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_lang_lint.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main _p sys_write sys_exit sys_mmap ll_read sys_openat_rd sys_read sys_close sys_openat_append ll_hit _fp sys_write ↻ _fn sys_mmap ↻ sys_write ↻ ll_params _fp ↻ _fn ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_close ↻

structs

none

consts

16const K_MAGIC_2097152: i64 = 2097152
17const K_MAGIC_2097136: i64 = 2097136

functions

18func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
19func _fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 2: ll_hitmain calls 1: sys_write
20func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 2: ll_hitmain calls 2: sys_mmapsys_write
21func ll_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
31func ll_params(buf: *u8, lp: i64, n: i64) -> i64
called by 1: main
50func ll_hit(lfd: i64, kind: *u8, line: i64, bad: *i64) -> i64
called by 1: main calls 2: _fp_fn
56func main(argc: i64, argv: *i64) -> i64