code wiki / _hdl_build / nx_asset_emit_gen.nx

nx_asset_emit_gen.nx

buildroot/runtime/_hdl_build/nx_asset_emit_gen.nx

6206 B110 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic asset
docsdependenciesstructsconstsfunctions

about

nx_asset_emit_gen.nx -- EMITTER-GENERATOR: turns any text asset into a NISHILANG EMITTER ORGAN, making the .nx the SSOT and the asset a generated artifact (operator 2026-07-02: "use and build up the nishi ecosystem including nishi lang" -- the last mile must be EMITTED by an organ, never hand-edited). usage: nx_asset_emit_gen <asset> <out.nx> <organ_name> <target_path> The generated organ: main(argc,argv) emits the asset bytes to <target_path> (argv[1] overrides the target -- that is the DRIFT-KILL seam: emit to a compare path, byte-diff vs the canonical file). Escaping: printable ASCII raw; '"'->\" '\\'->\\ LF->\n; all else -> \xHH with a FORCED literal break when the next byte is a hex digit (so the lexer can never over-consume the escape). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_asset_emit_gen.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ap hexd ishex apn sys_mmap ↻ sys_openat_wr sys_close ↻

structs

none

consts

11const K_MAGIC_65536: i64 = 65536
12const K_MAGIC_1200: i64 = 1200

functions

14func gl(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
15func ap(b: *u8, n: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){b[n+i]=s[i];i=i+1} return n+i }
called by 1: main
16func apn(b: *u8, n: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
19func hexd(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } // 0-9 a-f
called by 1: main
20func ishex(c: i64) -> i64
called by 1: main
26func main(argc: i64, argv: *i64) -> i64