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 regex parsing with slashes #53

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Fix regex parsing with slashes #53

merged 1 commit into from
Nov 22, 2024

Conversation

lydell
Copy link
Owner

@lydell lydell commented Nov 22, 2024

You can put [/] in a regex without escaping the slash: /[/]/.

js-tokens already knew about that, but there were only tests for that situation at the very beginning of regexes. /a[/]/ would fail to be parsed correctly, since a[ would be eagerly consumed by part of the regex literal regex.

Closes #52.

You can put `[/]` in a regex without escaping the slash: `/[/]/`.

js-tokens already knew about that, but there were only tests for that
situation at the very beginning of regexes. `/a[/]/` would fail to be
parsed correctly, since `a[` would be eagerly consumed by part of the
regex literal regex.

Closes #52.
@lydell lydell merged commit 72049c6 into main Nov 22, 2024
10 checks passed
@lydell lydell deleted the fix-regex-slash branch November 22, 2024 17:16
@lydell
Copy link
Owner Author

lydell commented Nov 22, 2024

Regression from #43

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.

RegularExpressionLiteral parse incorrect
1 participant