nx_rowparse_lib.nx
buildroot/runtime/nx_rowparse_lib.nx
about
nx_rowparse_lib.nx -- THE ONE ROW PARSER for delimited estate records, extracted 2026-09-04 because the
DRY law fires at THREE and the third copy had just been written. nx_debt_triple parsed TAB-delimited debt
rows, nx_aliascensus parsed TAB-delimited allowlist rows, and nx_refdrift parsed PIPE-delimited refs rows,
each with its own private slen, line-end, column, span-compare and number-emit -- the same arithmetic
written three times with three prefixes. Each copy was CORRECT; that is precisely why the duplication was
invisible, and why the estate's rule is a COUNT rather than a judgement about whether it feels duplicated.
THE SEPARATOR IS A PARAMETER, WHICH IS THE WHOLE REASON ONE LIB CAN SERVE ALL THREE. The three organs
differed on exactly one axis: TAB for the store planes, PIPE for the compare records. A lib that hardcoded
either would have forced the third organ to keep its private copy, which is how a shared lib acquires a
duplicate sibling and the count goes from three to four.
⚠A NOTE ON WHAT IS NOT HERE. Nothing in this file reads a file, forks, or decides anything. It is pure
span arithmetic over a caller-owned buffer, so a consumer's gate can exercise it with a hand-built fixture
and no I/O -- which is the property that made the three consumers gateable in the first place.
license_tier: ORIGINAL. No syscalls except the emit helpers' scratch allocation. No hw writes (Rule 26).
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_aliascensus.nxnx_board_idref_gate.nxnx_debt_triple.nxnx_refdrift.nx
structs
| none |
consts
| 19 | const RP_NL: i64 = 10 |
| 20 | const RP_TAB: i64 = 9 |
| 21 | const RP_PIPE: i64 = 124 |
| 22 | const RP_ZERO: i64 = 48 |
| 23 | const RP_NINE: i64 = 57 |
| 24 | const RP_MINUS: i64 = 45 |
| 25 | const RP_SCRATCH: i64 = 32 |
| 26 | const RP_TEN: i64 = 10 |
functions
| 28 | func rp_slen(s: *u8) -> i64 |
| 35 | func rp_le(b: *u8, i: i64, n: i64) -> i64 |
| 46 | func rp_col(b: *u8, s: i64, e: i64, col: i64, sep: i64, out: *i64) -> i64 |
| 63 | func rp_col_tab(b: *u8, s: i64, e: i64, col: i64, out: *i64) -> i64 |
| 66 | func rp_col_pipe(b: *u8, s: i64, e: i64, col: i64, out: *i64) -> i64 |
| 69 | func rp_span_eq(b: *u8, s: i64, l: i64, b2: *u8, s2: i64, l2: i64) -> i64 called by 1: main |
| 78 | func rp_lit_eq(b: *u8, s: i64, l: i64, lit: *u8) -> i64 |
| 89 | func rp_num(b: *u8, s: i64, l: i64) -> i64 |
| 103 | func rp_same(a: *u8, an: i64, b: *u8, bn: i64) -> i64 called by 1: rd_same |
| 112 | func rp_put(out: *u8, o: i64, s: *u8) -> i64 |
| 118 | func rp_putn(out: *u8, o: i64, v: i64) -> i64 |
| 131 | func rp_putspan(out: *u8, o: i64, b: *u8, s: i64, l: i64) -> i64 |
| 136 | func rp_cstr(dst: *u8, b: *u8, s: i64, l: i64) -> i64 called by 1: main |