code wiki / _hdl_build / nx_lang_lint.nx
nx_lang_lint.nx
buildroot/runtime/_hdl_build/nx_lang_lint.nx
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
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
structs
| none |
consts
| 16 | const K_MAGIC_2097152: i64 = 2097152 |
| 17 | const K_MAGIC_2097136: i64 = 2097136 |
functions
| 18 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func _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 } |
| 20 | func _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 } |
| 21 | func ll_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 31 | func ll_params(buf: *u8, lp: i64, n: i64) -> i64 called by 1: main |
| 50 | func ll_hit(lfd: i64, kind: *u8, line: i64, bad: *i64) -> i64 |
| 56 | func main(argc: i64, argv: *i64) -> i64 |