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

proposal-regexp-modifiers: Tests for syntax errors #3807

Closed
wants to merge 6 commits into from

Conversation

guijemont
Copy link
Contributor

This covers the syntax error cases from #3756.
This is an updated version of #3758 addressing review comments.

cjtenny and others added 6 commits March 31, 2023 22:16
Cases and templates to generate syntax error tests for regular expression modifiers, plus a few cases not worth templating.
Tests introduced by previous commits, generated from templates and cases by the usual scripts.
@guijemont guijemont changed the title proposal-regexp-modifiers: Tests for syntax errors #3758 proposal-regexp-modifiers: Tests for syntax errors Mar 31, 2023
@guijemont
Copy link
Contributor Author

guijemont commented Mar 31, 2023

The main issue why this is still a draft, is that the templated test generator has some issues.
In particular, we want to use it with templates such as:

/(?/*{ subpattern-add-modifiers }*/-/*{ subpattern-remove-modifiers }*/:a)//*{ global-modifiers }*/;

But the generator cannot replace /*{ global-modifiers }*/ as it seems to consider that //*{ global-modifiers }*/; is a comment. In otherwords, the generator needs to learn about how to handle comments that immediately follow a regex literal.

@guijemont
Copy link
Contributor Author

The main issue why this is still a draft, is that the templated test generator has some issues. In particular, we want to use it with templates such as:

/(?/*{ subpattern-add-modifiers }*/-/*{ subpattern-remove-modifiers }*/:a)//*{ global-modifiers }*/;

But the generator cannot replace /*{ global-modifiers }*/ as it seems to consider that //*{ global-modifiers }*/; is a comment. In otherwords, the generator needs to learn about how to handle comments that immediately follow a regex literal.

I created issue #3808 to report the problem.

Copy link
Contributor

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

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

This looks good as far as invalid syntax coverage is concerned, at least once #3808 is resolved.

ioannad added a commit to ioannad/test262 that referenced this pull request Feb 29, 2024
Based on PR tc39#3807 which had generated these tests from templates,
but was stuck due to issue tc39#3808.

Since these tests are a shipping blocker for v8,
and tc39#3808 seems not straight-forward to fix,
I modified the generated tests and removed the templates.

One test is missing, as noted by @rbuckton in tc39#3960 (comment)
to be added in a followup commit.
ptomato pushed a commit to ioannad/test262 that referenced this pull request Mar 5, 2024
Based on PR tc39#3807 which had generated these tests from templates,
but was stuck due to issue tc39#3808.

Co-Authored-By: Guillaume Emont <[email protected]>
Co-Authored-By: Ioanna M. Dimitriou H <[email protected]>
ptomato pushed a commit to ioannad/test262 that referenced this pull request Mar 5, 2024
Based on PR tc39#3807 which had generated these tests from templates,
but was stuck due to issue tc39#3808.

Co-Authored-By: Guillaume Emont <[email protected]>
Co-Authored-By: Ioanna M. Dimitriou H <[email protected]>
@ptomato
Copy link
Contributor

ptomato commented Mar 5, 2024

Closing in favour of #4016.

@ptomato ptomato closed this Mar 5, 2024
ptomato pushed a commit that referenced this pull request Mar 5, 2024
Based on PR #3807 which had generated these tests from templates,
but was stuck due to issue #3808.

Co-Authored-By: Guillaume Emont <[email protected]>
Co-Authored-By: Ioanna M. Dimitriou H <[email protected]>
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.

4 participants