code wiki / _hdl_build / nx_css_extract_test.nx
nx_css_extract_test.nx
buildroot/runtime/_hdl_build/nx_css_extract_test.nx
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
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
structs
| none |
consts
| none |
functions
| 12 | func nx_css_extract_elements(html: *u8, hlen: i64, elements: *CssElement, maxn: i64) -> i64 |
| 46 | func 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 } |
| 47 | func 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 } |
| 49 | func ce_tag_is(e: *CssElement, lit: *u8) -> i64 called by 1: main |
| 57 | func ce_val_is(src: *u8, off: i64, len: i64, lit: *u8) -> i64 called by 1: main |
| 65 | func el_at(elements: *CssElement, i: i64) -> *CssElement { return ((elements as i64) + i * NX_CSS_ELEMENT_BYTES) as *CssElement } called by 1: main |
| 67 | func main() -> i64 |