Provide source spans for tokens and DOM nodes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 288
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 8
Description
We can use something like libsyntax's Span and Spanned types to track positions in the input stream.
The tokenizer will remember its current position and the position at certain events, e.g. start tag, start attribute name. The tree builder will call a tree sink method (with an empty default) to annotate the DOM with span information.
Then we can write a command-line HTML validator with the same output UI as rustc :)
Note that eventually it will be possible for a single document's nodes to come from multiple text sources, e.g. with document.write.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the tokenizer and tree builder interfaces described in the issue, focusing on how positions and tree-sink callbacks are currently represented. Determine the span information required for tokens and DOM nodes, then verify that the resulting annotations support the proposed command-line validator output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100