code wiki / _attic / _offc_narr_smoke.nx

_offc_narr_smoke.nx source

↩ module page · 47 lines · 1305 B

1// Smoke test for nx_narr primitives. Exercises each primitive once 2// to verify it compiles + emits the expected book line. Sprint 1 3// gate: this must produce readable output before we instrument the 4// real compiler. 5 6import "nx_narr.nx" 7 8func main() -> i64 { 9 narr_chapter("PARSING function main of test.nx" as *u8) 10 narr_section("parsing statement at line 14 col 1" as *u8) 11 12 narr_moment( 13 NARR_ARCHITECT, 14 "parse_stmt" as *u8, 15 "parse.nx:1201" as *u8, 16 "defines" as *u8, 17 "9-way stmt dispatch table" as *u8, 18 "branches to one of 9 handlers" as *u8 19 ) 20 narr_moment( 21 NARR_AUTHOR, 22 "parse_stmt" as *u8, 23 "parse.nx:1219" as *u8, 24 "reads" as *u8, 25 "token kind=TK_STAR(42)" as *u8, 26 "dispatches to parse_stmt_star" as *u8 27 ) 28 narr_moment( 29 NARR_EDITOR, 30 "parse_stmt" as *u8, 31 "parse.nx:1219" as *u8, 32 "hands off" as *u8, 33 "control + Parser*P" as *u8, 34 "parse_stmt_star receives" as *u8 35 ) 36 37 narr_moment_int( 38 NARR_AUTHOR, 39 "ir_emit_store" as *u8, 40 "ir.nx:703" as *u8, 41 "allocates" as *u8, 42 "Instr#" as *u8, 4, 43 "from f.instr_pool" as *u8 44 ) 45 46 return 0 47}