-
Notifications
You must be signed in to change notification settings - Fork 479
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
[generation] Support comments directly following regular expression litterals #3808
Comments
FWIW this branch contains my (broken) attempt at fixing this, unfortunately I don't have more time to spend on this right now. |
I'm fine with fixing /*---
esid: …
…
placeholder-prefix: ' %%'
placeholder-suffix: '%% '
---*/
/(? %%subpattern-add-modifiers%% - %%subpattern-remove-modifiers%% :a)/ %%global-modifiers%% ; for accepting existing .case files like //- subpattern-add-modifiers
i
//- subpattern-remove-modifiers
//- global-modifiers
gu to produce content like |
I'm not sure I understand the difference - isn't |
It's invalid at a different layer of abstraction... |
After poking at this bug, I think I understand better why you are asking for this. It's simple enough to support Doing this extra work to support placeholder comments inside RegExp literals, however, means that we get all sorts of other arbitrary cases where the So, in the end I agree that we should use some other tokens to delimit placeholders inside RegExp literals. |
This fixes cases such as `/foo//*{ subst }*/` where previously the `//` would be interpreted as a single-line comment. We now keep track in find_comments() of when we are inside a RegExp literal. However, this breaks cases that used to work (but not tested; maybe this worked unintentionally?) of `/regexp /*{ subst }*//`. See: tc39#3808
This fixes cases such as `/foo//*{ subst }*/` where previously the `//` would be interpreted as a single-line comment. We now keep track in find_comments() of when we are inside a RegExp literal. However, this breaks cases that used to work (but not tested; maybe this worked unintentionally?) of `/regexp /*{ subst }*//`. See: tc39#3808 Co-authored-by: Guillaume Emont <[email protected]>
This fixes cases such as `/foo//*{ subst }*/` where previously the `//` would be interpreted as a single-line comment. We now keep track in find_comments() of when we are inside a RegExp literal. However, this breaks cases that used to work (but not tested; maybe this worked unintentionally?) of `/regexp /*{ subst }*//`. See: tc39#3808 Co-authored-by: Guillaume Emont <[email protected]>
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.
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]>
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]>
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]>
The generation tool does not properly substitute in cases such as:
Though something like this works:
It seems that
find_comments()
needs to learn about regexp literals and handle them properly.See #3807 (comment)
The text was updated successfully, but these errors were encountered: