nx_glsl_tokdiff.nx
buildroot/runtime/nx_glsl_tokdiff.nx
about
nx_glsl_tokdiff.nx -- THE SHADER TOKEN RULER, the program (gameengine S12c accept-rule instrument, 2026-09-05).
usage: nx_glsl_tokdiff <a.glsl> <b.glsl> -> THE CANONICAL DIFF (S12c-2): whitespace, comments, numeric spelling, compound
assignment, redundant parentheses, multi-declarators, brace-less branches and
counted loops normalised (see nx_glsl_tok_lib, THE CANONICAL FORM); exit 0 IDENTICAL /
1 DIFFERS / 2 UNREADABLE (the refusing token is named by byte offset and spelling).
shorter_is_prefix=1 is the per-SLICE accept signal of the cast port: an emitted slice
is proven when its canonical stream is a prefix of the hand text's, the whole shader
when the verdict reads IDENTICAL.
nx_glsl_tokdiff raw <a.glsl> <b.glsl> -> the incumbent token-level ruler (no structural normalisation), kept runnable so the
canonical form can always be measured against what it replaced.
nx_glsl_tokdiff extract <src> <start-marker> <end-marker> <out> [endincl]
-> copies the text between the markers (start exclusive; end exclusive, or INCLUSIVE
with the endincl word) and UNESCAPES the JS-literal spellings \n \" \\ so a shader
embedded in a page emitter's string can be judged as shader text. A backtick right
after the start marker (a JS template-literal opener) is skipped, so no caller has
to pass a backtick through a launcher (measured 2026-09-05: the argument vanished
and the run printed nothing). exit 0 / 2
One ruler (nx_glsl_tok_lib), composed in-process; the gate drives the same lib over planted fixtures in both directions.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 0 importers
imports: nx_glsl_tok_lib.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
| 22 | const TD_MODE_0644: i64 = 420 |
| 23 | const C_BSLASH: i64 = 92 |
| 24 | const C_DQUOTE: i64 = 34 |
| 25 | const C_BTICK: i64 = 96 |
| 26 | const C_n: i64 = 110 |
functions
| 28 | func td_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 34 | func td_find(buf: *u8, n: i64, from: i64, key: *u8) -> i64 |
| 47 | func td_extract(src: *u8, sm: *u8, em: *u8, outp: *u8, endincl: i64) -> i64 |
| 85 | func td_raw(pa: *u8, pb: *u8) -> i64 |
| 99 | func main(argc: i64, argv: *i64) -> i64 |