code wiki / _hdl_build / nx_doc_kwscan.nx
nx_doc_kwscan.nx
buildroot/runtime/_hdl_build/nx_doc_kwscan.nx
about
nx_doc_kwscan.nx -- DOCTOR reserved-keyword diagnosis (the reserved-kw sub-case of empty-.s, the sibling of the
let-reassign fixer). When dah_resolve returns DAH_NOFIX on an EMPTYS class, THIS pinpoints WHY: it finds an
identifier that collides with a NishiLang reserved keyword used in a position the grammar requires an identifier
(a let/var/const/static/func declared NAME, or a parameter NAME), and reports the keyword + byte offset + a safe
suggested rename. READ-ONLY BY CONSTRUCTION: it does NOT auto-rewrite -- a blind keyword rename could clobber a
legitimate keyword USE (a real `match {}` statement, a `return`, a `while`), so detection + suggestion is the
fail-safe boundary (the human/Doctor applies the rename with scope knowledge). The reserved-keyword set is the
AUTHORITATIVE lexer list (runtime/lex.nx keyword_lookup, 22 kw) -- NOT folklore: `type`/`import` are NOT lexer
keywords, so they are valid identifiers and are deliberately NOT flagged. license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_doc_heal_let.nx
imported by: nx_doc_autoheal_apply.nxnx_doc_build_resolve.nxnx_doc_kwscan_gate.nxnx_doc_mainscan.nx
structs
| none |
consts
| none |
functions
| 14 | func kw_eq(t: *u8, len: i64, lit: *u8) -> i64 |
| 22 | func kw_is_reserved(t: *u8, len: i64) -> i64 |
| 48 | func kw_is_decl(t: *u8, len: i64) -> i64 |
| 57 | func kws_prev_nonspace(src: *u8, i: i64) -> i64 called by 1: kws_scan |
| 63 | func kws_next_nonspace(src: *u8, n: i64, j: i64) -> i64 called by 1: kws_scan |
| 70 | func kws_scan(src: *u8, n: i64, outkw: *u8, outpos: *i64) -> i64 called by 3: mainmainmain calls 7: sys_mmapdhl_isidentdhl_name_atkw_is_declkw_is_reservedkws_prev_nonspace+1 |
| 119 | func kws_suggest(kw: *u8, out: *u8) -> i64 |