← Blog
0.7.0 · APPS · BROWSER

URL Parser — T10 Sprint

June 23, 2026 · sigil-apps 1f59b70 · Sigil-Docs
apps browser net 0.7.0

url_parser.sg arrives as the first piece of the T10 sprint — parsing a full URL string at str_buf @0x400000 into 6 structured components (scheme, host, port, path, query, fragment) stored as (offset, length) pairs at url_parts_buf @0x410000 (16 B each). URL-PARSER-PASS. 11688 B arm-el0.


Parse model

Component extraction and port defaults

The parser scans bytes in str_buf @0x400000 for the standard RFC 3986 delimiters: : after scheme, // before authority, : in authority for port, / before path, ? before query, # before fragment.

Each component is stored as a (len, off) pair (16 B: two u64 fields) at url_parts_buf @0x410000. Component order: 0=scheme, 1=host, 2=port, 3=path, 4=query, 5=fragment.

Port handling: if an explicit :port is present in the authority, that value is used; otherwise port defaults by scheme — http → 80, https → 443, others → 0.

Test: 2 URLs parsed, 10/10 component checks PASS. URL-PARSER-PASS.