code wiki / _hdl_build / nx_doc_kwscan.nx

nx_doc_kwscan.nx

buildroot/runtime/_hdl_build/nx_doc_kwscan.nx

6226 B125 linesdepth 3pulls 3 transitivereach 5 importersview sourcekind librarytopic doc
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_doc_heal_let.nx nx_doc_kwscan.nx nx_doc_autoheal_apply.nx nx_doc_build_resolve.nx nx_doc_kwscan_gate.nx nx_doc_mainscan.nx

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

14func kw_eq(t: *u8, len: i64, lit: *u8) -> i64
22func kw_is_reserved(t: *u8, len: i64) -> i64
called by 1: kws_scan calls 1: kw_eq
48func kw_is_decl(t: *u8, len: i64) -> i64
called by 1: kws_scan calls 1: kw_eq
57func kws_prev_nonspace(src: *u8, i: i64) -> i64
called by 1: kws_scan
63func kws_next_nonspace(src: *u8, n: i64, j: i64) -> i64
called by 1: kws_scan
70func kws_scan(src: *u8, n: i64, outkw: *u8, outpos: *i64) -> i64
119func kws_suggest(kw: *u8, out: *u8) -> i64
called by 3: mainmainmain