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 selector list of non-trivial selectors #5

Closed
matheus23 opened this issue Sep 10, 2020 · 2 comments
Closed

Fails to parse selector list of non-trivial selectors #5

matheus23 opened this issue Sep 10, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@matheus23
Copy link

I tried to parse this: .prose ul ul, .prose ul ol, .prose ol ul, .prose ol ol succeeds tokenizing, but fails with the error:

Error: Incorrect comma at 0
nestTokens@https://projects.verou.me/parsel/parsel.js:173:12
nestTokens@https://projects.verou.me/parsel/parsel.js:205:11
nestTokens@https://projects.verou.me/parsel/parsel.js:176:15
parse@https://projects.verou.me/parsel/parsel.js:244:22
tryout.oninput@https://projects.verou.me/parsel/:126:44
EventHandlerNonNull*@https://projects.verou.me/parsel/:120:2

(in the web version)

Here's some input-debugging:

  • a, b c, d fails with Incorrect comma at 0.
  • b c, d works.
  • a, b c works.
  • a, b c, fails with Incorrect comma at 0 (even though I'd expect another error)
  • a, b, d works.

I'm not sure what's happening. It has something to do with a non-trivial selector in the second item in the list.

Also: It'd be great to have this as an npm module uploaded. Is that planned? :)

@LeaVerou
Copy link
Owner

Oh wow. Thank you, looking into it now.

@LeaVerou LeaVerou added the bug Something isn't working label Sep 10, 2020
@LeaVerou
Copy link
Owner

Bug should be fixed, and the code is actually more readable now. Thank you! :)

Also: It'd be great to have this as an npm module uploaded. Is that planned? :)

Here you go! https://www.npmjs.com/package/parsel-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants