code wiki / _hdl_build / nx_regex.nx
nx_regex.nx
buildroot/runtime/_hdl_build/nx_regex.nx
about
nx_regex.nx -- SOVEREIGN linear-time regex GATE, now on the GENERAL nx_regex_lib (rule 15). Linear NFA state-set,
NO backtracking => ReDoS-IMMUNE (the RE2/Go design). Subset: literal/./*/+/?/[..]/^/$. (|/() = follow-on.)
T1-T6 correctness. T7 EXCEED: ReDoS-pathological match runs in LINEAR steps (measured). T8 teeth: non-match=0.
expect_exit: 0 Sovereign: nx_regex_lib (+ nx_syscalls).
dependencies 3 imports · 0 importers
imports: nx_regex_lib.nxnx_itoa_lib.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
| 8 | const K_MAGIC_2000: i64 = 2000 |
functions
| 10 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func g_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 16 | func ck(name: *u8, c: i64) -> i64 { if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return c } |
| 18 | func main() -> i64 |