-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: add support for ES2025 duplicate named capturing groups #195
Conversation
How does this handle backreferences? The |
Thank you for letting me know! I think we need to change the node. |
Maybe. You currently implemented type Backreference = AmbiguousBackreference | UnambiguousBackreference
interface BaseBackreference {
type: "Backreference"
// other props
ambiguous: boolean
resolved: CaptruingGroup | CaptruingGroup[]
}
interface AmbiguousBackreference extends BaseBackreference {
ambiguous: true
resolved: CaptruingGroup[]
}
interface UnambiguousBackreference extends BaseBackreference {
ambiguous: false
resolved: CaptruingGroup
} The interface/property names could use some work, but I hope I communicated the idea. This wouldn't be a breaking change, because regexes without duplicate group names produce the same AST as before (except for the additional However, I'm not sure whether this AST is ideal. It's backwards compatible, but it's also a bit more tricky to understand. |
Thank you! That's a good idea! |
test/fixtures/parser/literal/duplicate-named-capturing-group-invalid-2025.json
Show resolved
Hide resolved
BREAKING CHANGE: add support for ES2025 duplicate named capturing groups
@eslint-community/regexpp I think this is now ready for review. |
@eslint-community/core-team Can someone please review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
🎉 This PR is included in version 4.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
close #194