nx_doc_extractor_nx.nx
buildroot/runtime/hub/nx_doc_extractor_nx.nx
about
nx_doc_extractor_nx.nx -- V2.0 P-6: deep .nx artifact parser.
Reads .nx body bytes; extracts import_count + export_count for
populating NxArtifactStore.import_count + export_count fields.
Composes existing primitives.
COMPOSES:
nx_html_extract.nx_he_match_ci (case-sensitive byte prefix match)
(caller passes body bytes already loaded via sys_read_file)
COMPOSED BY:
wiki/nx_pipeline_walker (V3+ swap; V2.0 uses hardcoded zero values)
V2.0 P-6 SCOPE:
- Count "import " line-starts -> import_count
- Count "func " line-starts (non-comment) -> export_count
- Skip lines inside `// ...` comment blocks (single-line)
- Bounded by body byte count
- Pure-function; no allocation; no state
V3+ SCOPE (TODO):
- Parse sealed verdict const ranges (NX_XXX_OK = 0)
- Parse struct decls (struct NxXxx { ... })
- Parse `// depends:` comment-block declared deps
- Parse `// disk_kb:` budget hint
- Identify pub vs internal funcs (current: all `func` count as exports)
Status: V2.0 P-6. 2026-05-27.
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_html_extract.nx
imported by: nx_pipeline_graph_builder.nxnx_pipeline_walker.nx
structs
| none |
consts
| 34 | const NX_DXNX_OK: i64 = 0 |
| 35 | const NX_DXNX_BAD_INPUT: i64 = 3020 |
| 36 | const NX_DXNX_LOOP_BUDGET: i64 = 3021 |
| 39 | const NX_DXNX_MAX_BODY: i64 = 1048576 // 1 MB cap |
| 40 | const NX_DXNX_LOOP_BUDGET_CAP: i64 = 10000000 |
| 43 | const NX_DXNX_ASCII_NL: i64 = 0x0A |
| 44 | const NX_DXNX_ASCII_SLASH: i64 = 0x2F |
| 45 | const NX_DXNX_ASCII_SPACE: i64 = 0x20 |
| 46 | const NX_DXNX_ASCII_TAB: i64 = 0x09 |
| 162 | const NX_DXNX_MAX_IMPORT_LEN: i64 = 128 |
functions
| 50 | func nx_dxnx_line_starts_with(src: *u8, line_off: i64, body_n: i64, |
| 72 | func nx_dxnx_line_is_comment(src: *u8, line_off: i64, body_n: i64) -> i64 |
| 101 | func nx_doc_extract_nx_stats(body: *u8, body_n: i64, |
| 164 | func nx_doc_extract_nx_imports(body: *u8, body_n: i64, |
| 244 | func nx_doc_imports_iter_next(buf: *u8, buf_used: i64, off: i64, called by 1: nx_pipeline_build_dep_graph |