code wiki / (root) / self_parse_test.nx

self_parse_test.nx

buildroot/runtime/self_parse_test.nx

2314 B49 linesdepth 6pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic self
docsdependenciesstructsconstsfunctions

about

self_parse_test.nx -- feed parse.nx's OWN source through the nx-side lex + parse pipeline and verify it completes without structural crashes. This is a soft self-host milestone: parse.nx, tokenized by lex.nx and parsed by parse.nx at runtime, should produce a Module with roughly the same number of functions it actually declares. We don't bit-diff the IR yet; only check that the pipeline reaches the end without aborting. Source-text-embedding: we use a smaller but representative NishiLang program that exercises most of parse.nx's dispatch paths in a way the linker-embedded string literal can stretch to.

dependencies 6 imports · 0 importers

syscalls.nx types.nx lex_kinds.nx ir.nx lex.nx parse.nx self_parse_test.nx

imports: syscalls.nxtypes.nxlex_kinds.nxir.nxlex.nxparse.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main lex_source skip_ws_comments peek advance peek2 peek ↻ is_alpha lex_ident_or_kw tok_text_ptr peek ↻ is_alnum is_alpha ↻ is_digit advance ↻ keyword_lookup push_tok is_digit ↻ lex_number peek ↻ peek2 ↻ advance ↻ is_hexdigit is_digit ↻ hex_val push_tok ↻ is_digit ↻ lex_string advance ↻ tok_text_ptr ↻ peek ↻ push_tok ↻ peek2 ↻ emit_punct advance ↻ push_tok ↻ advance ↻ push_tok ↻ parse_module prepass_register_structs

structs

none

consts

none

functions

22func main() -> i64 {