code wiki / _hdl_build / nx_doc_demo_kw.nx
nx_doc_demo_kw.nx source
↩ module page · 12 lines · 602 B
1// nx_doc_demo_kw.nx -- the SECOND empty-.s sub-case for dogfooding: a reserved keyword (`match`) used as a
2// parameter name. The compiler emits an empty .s (the parser needs an identifier, gets a keyword). The let-fixer
3// cannot help here -> nx_doc_autoheal_apply returns NOFIX and kws_scan pinpoints the exact keyword + offset + a
4// safe suggested rename. EXPECTED to fail to build; that failure is this sub-demo's starting state.
5import "nx_syscalls.nx"
6
7func q(match: i64) -> i64 { return match + 1 }
8
9func main() -> i64 {
10 sys_write(1, "nx_doc_demo_kw: ran\n" as *u8, 19)
11 return q(41)
12}