-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for named groups #14
Add support for named groups #14
Conversation
I think that the failing tests are not related to this PR. |
Codecov Report
@@ Coverage Diff @@
## master #14 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 151 186 +35
Branches 46 56 +10
=====================================
+ Hits 151 186 +35
Continue to review full report at Codecov.
|
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.
Sorry for the delay in reviewing this. I’ve pushed some changes, and fixed the build errors on master. Could you please rebase and take a look at the indirect call? Thanks.
rewrite-pattern.js
Outdated
groups.names[name] = index; | ||
if (groups.onNamedGroup) { | ||
// Indirect call is needed to not leak 'groups' | ||
(0, groups.onNamedGroup)(name, index); |
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.
Huh? This feels a little magical…
49aa21d
to
aae9459
Compare
Rebased |
Thanks for your contribution, @nicolo-ribaudo! |
This still needs a new version ofregjsparser
to be released (I usedyarn link
locally).Also, I have a question: what should these regexs be transformed to?I just had to read the spec 🙂/\k<name>/
,/(?<name>)(?<name>)\k<name>