code wiki / _hdl_build / nx_lex_kat.nx

nx_lex_kat.nx

buildroot/runtime/_hdl_build/nx_lex_kat.nx

2894 B43 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic lex
docsdependenciesstructsconstsfunctions

about

nx_lex_kat.nx -- EXHAUSTIVE KAT for nx_lex (lexer whitespace + identifier classifiers). HONESTY [W] weak point (reach=180, 12 children). All 256 bytes vs inlined ground truth. license_tier: ORIGINAL expect_exit:0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_lex.nx nx_lex_kat.nx

imports: nx_syscalls.nxnx_lex.nx

imported by: nobody (leaf or entry point)

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

main nx_lex_is_ws gt_ws nx_lex_is_intraline_ws gt_iws nx_lex_is_id_cont_math nx_ascii_is_id_start nx_ascii_is_alpha nx_ascii_is_lower nx_ascii_is_upper gt_idmath gt_idstart nx_lex_is_id_cont_qualifie nx_ascii_is_id_start ↻ gt_idqual gt_idmath ↻ w sys_write n sys_mmap sys_write ↻

structs

none

consts

none

functions

6func w(s: *u8) -> i64 { var k:i64=0; while s[k]!=(0 as u8){k=k+1} sys_write(1,s,k); return 0 }
called by 1: main calls 1: sys_write
7func n(v: i64) -> i64 { let b:*u8=sys_mmap(24); var m:i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let t:*u8=sys_mmap(24); 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 j:i64=0; while j<k{b[j]=t[k-1-j];j=j+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
9func gt_ws(c: i64) -> i64 { if c==32 { return 1 } if c==9 { return 1 } if c==10 { return 1 } if c==13 { return 1 } return 0 }
called by 1: main
10func gt_iws(c: i64) -> i64 { if c==32 { return 1 } if c==9 { return 1 } return 0 }
called by 1: main
11func gt_idstart(c: i64) -> i64 { if c>=97 { if c<=122 { return 1 } } if c>=65 { if c<=90 { return 1 } } if c==95 { return 1 } return 0 }
called by 1: gt_idmath
12func gt_idmath(c: i64) -> i64 { if gt_idstart(c)==1 { return 1 } if c>=48 { if c<=57 { return 1 } } if c==39 { return 1 } return 0 }
called by 2: gt_idqualmain calls 1: gt_idstart
13func gt_idqual(c: i64) -> i64 { if gt_idmath(c)==1 { return 1 } if c==46 { return 1 } return 0 }
called by 1: main calls 1: gt_idmath
15func main() -> i64