New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(selector-parser): group nodes by compound selector #33
Merged
Conversation
This file contains 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
- new util to group selector parts by dom target - added new grouped_selector AST type
- new AST selector type for a list of AST that targets a DOM element - new AST type for comment with no spacing - added a bunch of type conditions to selector test-kit createNode - change groupSelectorTargets to use new CompoundSelector AST - return input selector/s with shallow grouping of compound selectors
idoros
changed the title
feat(selector-parser): group selectors by target
feat(selector-parser): group nodes by compound selector
Jul 27, 2021
- shouldn't change if ast types are added
- split Immutable type for better type description (typescript output)
- changed immutable type to handle tuples better
- not just specific nth nodes
barak007
approved these changes
Aug 3, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
barak007
approved these changes
Aug 3, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
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.
This PR add a new type of selector:
CompoundSelector
, which represents a list of Selectors that query a single element in the DOM. And tools to group AST into the new compound selector and flatten it back (resolve #23 ).Nesting|CommentsWithSpacing|Invalid|CompoundSelector|Selector
)universal | type
must only be placed as the first nodenth
types for now)selector | compound
pseudo-element
into a separate compound (with option to override behavior)