code wiki / _hdl_build / nx_ascii_kat.nx

nx_ascii_kat.nx

buildroot/runtime/_hdl_build/nx_ascii_kat.nx

4963 B93 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_ascii_kat.nx -- EXHAUSTIVE differential gate for nx_ascii (HONESTY SYSTEM weak point reach=267; used across lexer/formatter/strconv/path -- a boundary bug there cascades). For ALL 256 byte values, each classifier must equal the independently-computed ASCII ground truth -> catches every off-by-one at every boundary at once (stronger than the in-file smoke). Self-validating: ground truth is inlined, not the organ. license_tier: ORIGINAL expect_exit:0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_ascii.nx nx_ascii_kat.nx

imports: nx_syscalls.nxnx_ascii.nx

imported by: nobody (leaf or entry point)

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

main nx_ascii_is_digit gt_digit nx_ascii_is_lower gt_lower nx_ascii_is_upper gt_upper aw sys_write an sys_mmap sys_write ↻ nx_ascii_is_alpha nx_ascii_is_lower ↻ nx_ascii_is_upper ↻ gt_alpha gt_lower ↻ gt_upper ↻ nx_ascii_is_alnum nx_ascii_is_alpha ↻ nx_ascii_is_digit ↻ gt_alnum gt_alpha ↻ gt_digit ↻ nx_ascii_is_id_start nx_ascii_is_alpha ↻ gt_id_start gt_alpha ↻ nx_ascii_is_id_cont nx_ascii_is_alnum ↻ gt_id_cont gt_alnum ↻ nx_ascii_is_space gt_space nx_ascii_is_print gt_print nx_ascii_is_hex nx_ascii_is_digit ↻ gt_hex gt_digit ↻

structs

none

consts

none

functions

9func aw(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
10func an(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
13func gt_digit(c: i64) -> i64 { if c>=48 { if c<=57 { return 1 } } return 0 }
called by 3: gt_alnumgt_hexmain
14func gt_lower(c: i64) -> i64 { if c>=97 { if c<=122 { return 1 } } return 0 }
called by 2: gt_alphamain
15func gt_upper(c: i64) -> i64 { if c>=65 { if c<=90 { return 1 } } return 0 }
called by 2: gt_alphamain
16func gt_alpha(c: i64) -> i64 { if gt_lower(c)==1 { return 1 } return gt_upper(c) }
17func gt_alnum(c: i64) -> i64 { if gt_alpha(c)==1 { return 1 } return gt_digit(c) }
called by 2: gt_id_contmain calls 2: gt_alphagt_digit
18func gt_hex(c: i64) -> i64 { if gt_digit(c)==1 { return 1 } if c>=97 { if c<=102 { return 1 } } if c>=65 { if c<=70 { return 1 } } return 0 }
called by 1: main calls 1: gt_digit
19func gt_space(c: i64) -> i64 { if c==32 { return 1 } if c==9 { return 1 } if c==10 { return 1 } if c==13 { return 1 } if c==11 { return 1 } if c==12 { return 1 } return 0 }
called by 1: main
20func gt_print(c: i64) -> i64 { if c>=32 { if c<=126 { return 1 } } return 0 }
called by 1: main
21func gt_id_start(c: i64) -> i64 { if gt_alpha(c)==1 { return 1 } if c==95 { return 1 } return 0 }
called by 1: main calls 1: gt_alpha
22func gt_id_cont(c: i64) -> i64 { if gt_alnum(c)==1 { return 1 } if c==95 { return 1 } return 0 }
called by 1: main calls 1: gt_alnum
24func main() -> i64