code wiki / _hdl_build / nx_css_extract_test.nx

nx_css_extract_test.nx

buildroot/runtime/_hdl_build/nx_css_extract_test.nx

5808 B111 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic css
docsdependenciesstructsconstsfunctions

about

nx_css_extract_test.nx -- styling rung 1: extract a CssElement[] (tag/id/class per element, in document order) automatically from real HTML, so the cascade (nx_css_apply) has something to match. Today CssElement[] is hand-built (css_apply_test); this is the missing auto-extractor. Composes the gated nx_html_tokenizer (element walk) + nx_dom_query (nx_dom_find_attr for id/class). Self-contained + gated; the function moves to a library when wired into the render. expect_exit: 0.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_html_tokenizer.nx nx_dom_query.nx nx_css_selector_match.nx nx_css_extract_test.nx

imports: nx_syscalls.nxnx_html_tokenizer.nxnx_dom_query.nxnx_css_selector_match.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nx_css_extract_elements sys_mmap ↻ nx_html_cursor_init nx_html_next_token _scan_name _is_name _is_void_element _lc nx_dom_find_attr _dq_strlen _dq_find_substr_ci _dq_byte_eq_ci _dq_lc ce_puts sys_write ce_pn sys_mmap ↻ sys_write ↻ ce_tag_is el_at ce_val_is sys_exit

structs

none

consts

none

functions

12func nx_css_extract_elements(html: *u8, hlen: i64, elements: *CssElement, maxn: i64) -> i64
46func ce_puts(s: *u8) -> i64 { var k: i64=0; while s[k]!=(0 as u8){k=k+1} sys_write(1,s,k); return 0 }
called by 1: main calls 1: sys_write
47func ce_pn(v: i64) -> i64 { let b: *u8=sys_mmap(20); var m: i64=v; let t: *u8=sys_mmap(20); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
49func ce_tag_is(e: *CssElement, lit: *u8) -> i64
called by 1: main
57func ce_val_is(src: *u8, off: i64, len: i64, lit: *u8) -> i64
called by 1: main
65func el_at(elements: *CssElement, i: i64) -> *CssElement { return ((elements as i64) + i * NX_CSS_ELEMENT_BYTES) as *CssElement }
called by 1: main
67func main() -> i64