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

Fix ClassSetCharacter parsing #143

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

JLHwung
Copy link
Collaborator

@JLHwung JLHwung commented Sep 26, 2024

In this PR we fixed two spec compliance issues about the regexp unicode sets mode.

We also aligned the production names in comments to the latest ES2025 draft, so it is easier to check the implementation.

Please review this PR by commits. The second and third one are the actual fixes.

/cc @nicolo-ribaudo

@JLHwung JLHwung force-pushed the fix-unicode-set-class-contents branch from 4e4ba86 to af5ee57 Compare September 26, 2024 19:37
@@ -914,76 +914,10 @@
"raw": "[[a-z]&&[p-s]]"
},
"[AB&&CD]": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is invalid in unicode sets mode. V8 12.6 also throws "Invalid set operation in character class".

"message": "Invalid set operation in character class at position 3\n [@@]\n ^",
"input": "[@@]"
},
"[^^^]": {
Copy link
Collaborator Author

@JLHwung JLHwung Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/[^^]/v is actually valid due to the negation. To test the reserved double punctuator we have to construct a case where ^^ is seen in the middle.

@jviereck
Copy link
Owner

Hi @JLHwung , thanks for your PR! From a coding side, this looks good to me. Waiting in case @nicolo-ribaudo has comments.

@JLHwung JLHwung mentioned this pull request Sep 27, 2024
Copy link
Collaborator

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jviereck jviereck merged commit 668eca6 into jviereck:gh-pages Oct 1, 2024
@jviereck
Copy link
Owner

jviereck commented Oct 1, 2024

Thank you for the PR @JLHwung and thank you @nicolo-ribaudo for the review!

@JLHwung JLHwung deleted the fix-unicode-set-class-contents branch October 1, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants