Add absolute source offsets to parsed selector nodes - #341
Draft
DeepanshuPal wants to merge 4 commits into
Draft
DeepanshuPal wants to merge 4 commits into
DeepanshuPal wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #251. Parsed nodes now include zero-based UTF-16
source.start.offsetand inclusivesource.end.offset, derived from the tokenizer's existing positions. The public TypeScript declaration includes the optional offsets.Tests cover multiline and nested selectors, CRLF, attributes, named combinators, empty pseudos, and words joined from multiple tokens. I claimed the issue after the maintainer welcomed a PR. Opening as a draft for review.
Validation:
npm test(804 passed), lint, typecheck and coverage passed;git diff --checkpassed.format:checkfails only on untouchedsrc/__tests__/exceptions.mjs, which fails on the clean HEAD as well. AI assistance was used for investigation and implementation; outputs and tests were reviewed locally.