nx_lex.nx
buildroot/runtime/nx_lex.nx
about
nx_lex.nx -- canonical lexer primitives (source-code whitespace).
Distinct from nx_ascii.nx by design: nx_ascii follows POSIX
isspace() / isalpha() semantics (broad, including VT and FF for
whitespace). nx_lex provides STRICT source-code-oriented variants
used by parsers that need precise control over what counts as
whitespace.
CONSOLIDATION TRAIL (verified via nx_func_compare 2026-05-13):
nx_lex_is_ws (4-char: space, tab, LF, CR) replaces 9 byte-identical
adapter-local variants:
- nx_coq_is_ws (hash 5493497725180460624)
- nx_extract_is_ws (hash 5493497725180460624)
- nx_hol_is_ws (hash 5493497725180460624)
- nx_isa_is_ws (hash 5493497725180460624)
- nx_lean_is_ws (hash 5493497725180460624)
- nx_mizar_is_ws (hash 5493497725180460624)
- nx_mm_is_ws (hash 5493497725180460624)
- nx_json_is_ws (semantically equivalent; hex-vs-decimal literals)
Why distinct from nx_ascii_is_space: nx_ascii_is_space also accepts
0x0B (vertical tab) and 0x0C (form feed); adapter is_ws was strict
to the 4 source-code chars. Preserving the strict semantics here.
nx_lex_is_intraline_ws (2-char: space, tab) replaces:
- nx_kv_is_ws (record-separator parsers must NOT treat
newline as whitespace)
genealogy_id: ascii_1968_standard + posix_isspace_traditions
+ source_code_lexer_conventions
lineage_id: character_class_predicate
axioms: NX_AX_LOGIC_EXCLUDED_MIDDLE (each c is or is not ws,
no third state)
dependencies 3 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: syscalls.nxnx_axioms.nxnx_ascii.nx
imported by: nx_coq_ingest.nxnx_func_extract.nxnx_hol_ingest.nxnx_isabelle_ingest.nxnx_json.nxnx_kv.nxnx_lean_ingest.nxnx_lex_kat.nxnx_mizar_ingest.nxnx_narrative_ingest.nxnx_substrate_evolve.nxnx_substrate_propose.nxnx_theorem_ingest.nx
structs
| none |
consts
| none |
functions
| 48 | func nx_lex_is_ws(c: i64) -> i64 |
| 59 | func nx_lex_is_intraline_ws(c: i64) -> i64 |
| 88 | func nx_lex_is_id_cont_math(c: i64) -> i64 |
| 98 | func nx_lex_is_id_cont_qualified(c: i64) -> i64 |