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
2 subst()
calls within a single scope breaks compilation
#810
Labels
mtail-Language/VM
Issues related to the mtail language, compiler, or VM
Comments
The problem is that the regular expression creates the numbered match
variables automatically, and the second regular expression then conflicts
in the same scope as the first.
There are two issues:
1) the numbered matches are not referenced so they should not matter
2) as the argument to subst the scope is even smaller and they should not
be leaking into the calling scope
Thanks for the report!
…On Sat, 17 Feb 2024, 00:51 EconomicTouristsArmLate, < ***@***.***> wrote:
Having 2 subst() calls within a single scope breaks with the error
message:
Redeclaration of capture group `0' previously declared at apache2.access.mtail:63:20-24
This example works fine:
gauge foo by asdf
gauge bar by asdf
/(?P<asdf>.+)/ {
foo[subst(/\d/, "", $asdf)]++
/.+/ {
bar[subst(/\d/, "", $asdf)]++
}
}
while this throws the Redeclaration of capture group 0 error:
gauge foo by asdf
gauge bar by asdf
/(?P<asdf>.+)/ {
foo[subst(/\d/, "", $asdf)]++
bar[subst(/\d/, "", $asdf)]++
}
previous report: #693 <#693>
—
Reply to this email directly, view it on GitHub
<#810>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXFX62OEXZ5S7FD7YDTHIDYT5P7XAVCNFSM6AAAAABDMCKE52VHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZTQNRXGAZTAMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
jaqx0r
added
the
mtail-Language/VM
Issues related to the mtail language, compiler, or VM
label
Apr 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Having 2
subst()
calls within a single scope breaks with the error message:This example works fine:
while this throws the
Redeclaration of capture group 0
error:previous report: #693
The text was updated successfully, but these errors were encountered: