Skip to content
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

Fails to parse CSS Selectors Level 4 extensions to :not selectors for compound rulesets #3640

Closed
rjgotten opened this issue Aug 2, 2021 · 3 comments

Comments

@rjgotten
Copy link
Contributor

rjgotten commented Aug 2, 2021

Version 4.1.1 - i.e. current as of this writing - and earlier of Less seems to improperly handle parsing of the :not pseudo-selector, which causes it throw the error "Missing a closing ')'" when encountering a CSS Selectors Level 4 compound :not - e.g.

:not(.foo, .bar) {
}

My guess is that the parser component for selector rulesets does a naïve global split based on comma characters into constituent selector rules to process. If this is the case, then it needs to implement a proper front-to-back parse of the whole thing instead, as that would allow it to detect whether the comma occurs within the nested context of a pseudo-selector or not.

@iChenLei
Copy link
Member

iChenLei commented Aug 2, 2021

Duplicate #3622 , more detail #3622 (comment)

Less v5 development is working in progress, https://github.com/matthew-dean/less.js/tree/5.x . Matthew (current core maintainer) use chevrotain to write new less parser, so he doesn't have much time to fix less 4.x .

@matthew-dean
Copy link
Member

Less v5 development is working in progress, https://github.com/matthew-dean/less.js/tree/5.x . Matthew (current core maintainer) use chevrotain to write new less parser, so he doesn't have much time to fix less 4.x .

@iChenLei Please don't take the existence of that branch as proof that a Less v5 release will happen (based on that branch). We can discuss on Gitter if you like; it's unrelated to this issue.

We should close this as a dupe of #3622, I think?

@iChenLei
Copy link
Member

iChenLei commented Aug 2, 2021

Sorry, Sir. My fault.

@iChenLei iChenLei closed this as completed Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants