feat(std/html): HTML tokenizer and character references (step 1 of #79) #443
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/439-html-tokenizer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #439
Task
Step 1 of #79: the
std/htmlpackage with the WHATWG tokenizer (80 states) and the character references, in TorbScript only (loop task #439, 2026-10-23).What
std/html:HtmlTokenizer(state, last start tag and CDATA allowance are public and settable),HtmlToken,HtmlParseError; errors are a list beside the tokens, reading never fails.lib.trbre-exports bypublic use.std/html/src/entities.trbis generated from the WHATWG table (2231 names: 2125 with;, 106 legacy) bytools/html/generate.trb. Longest match, legacy names without;, the attribute rule, numeric references with the C1 table and the error cases.std/html/tests/html5libbytools/html/vendor.trb(MIT,std/html/tests/NOTICE.mdlists the skipped and adjusted cases with the reason). Local run: 7000 cases, 0 failures, including error codes and positions.html.test.trb(¬,¬it;,&in text and attribute,€,�,�,�, count 2231).docs/standard-library/html.md, index and regeneratedskills/.Test
Local quick checks:
torb format --check,torb check, hand tests and html5lib harness. Gates and the std tests (native and VM) run in forge CI.Linear time (1 MiB vs 2 MiB,
linear.test.trb): forge CI prints a passing gate's output nowhere, so the CI number is still to be read (see the comment on #439). Local run in the VM: 1 MiB in 8.80 s, 2 MiB in 17.85 s, ratio 2.03.Forge CI on the final head: all gates green,
test (std/example packages)native 655 s and VM 672 s.e02ba4bd43177ec20e25177ec20e25fe8c4b8b83Approved at
fe8c4b8.tokenizer.test.trb, plus spot tests inhtml.test.trbandlinear.test.trb. CI is green for this head (gates, tier A/B, bootstrap, pdisc).lineStarts, so nothing quadratic is visible. Skipped and adjusted cases (lone surrogates, pending spec changes, xmlViolation) are listed with reasons inNOTICE.md.std/html, its generator and vendor tools, docs and the regenerated skill copy. No crons or automation.docs/standard-library/html.md, indexes,INDEX.mdand.pdisc-sidecar.yamlare updated, and the pdisc check is green.Non-blocking:
Linear time ... LINEAR_PLACEHOLDER. Fill in the measured 1 MiB / 2 MiB numbers, or drop the line.linear.test.trbonly asserts on token counts and prints the times.std/html(step 1 of #79) #439std/htmldocuments (epic) #79