[perl #125618] [REGEX] Positional capture of separator on ?% operator causes compiler error

[email protected] ("Zoffix Znet via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
On Wed, 15 Jul 2015 07:31:55 -0700, lue wrote:
> <ShimmerFairy> m: say "ab" ~~ /^ a +% (b) $/
> <camelia> rakudo-moar e4077e: OUTPUT«Nil␤»
> <ShimmerFairy> m: say "ab" ~~ /^ a *% (b) $/
> <camelia> rakudo-moar e4077e: OUTPUT«Nil␤»
> <ShimmerFairy> m: say "ab" ~~ /^ a ?% (b) $/
> <camelia> rakudo-moar e4077e: OUTPUT«===SORRY!===␤QAST::Block with
> cuid cuid_1_1436969557.11546 has not appeared␤»
> 
> On JVM:
> 
> <ShimmerFairy> j: say "ab" ~~ /^ a ?% (b) $/
> <camelia> rakudo-jvm e4077e: OUTPUT«===SORRY!===␤setcodeobj can only
> be used with a CodeRef␤»
> 
> And just to show that it's not just the ?% operator alone contributing
> to the issue, but the capture too:
> 
> <ShimmerFairy> m: say "ab" ~~ /^ a ?% [b] $/
> <camelia> rakudo-moar e4077e: OUTPUT«Nil␤»


Made potential fix in branches in https://github.com/perl6/nqp/commit/ac3d5307f3 and https://github.com/perl6/roast/commit/f2b07afbba

The fix is to throw on `?`/`??` quantifiers used with `%`/`%%`.

It's blocked by 2 lines of 6.c tests that indirectly use this combination: https://github.com/perl6/roast/commit/aaa71d077431cd0a86be84bd386e1032a12e8697#diff-ae7b47444302486e790af6ee18121fabR16 

I delegated it to the release manager whether to merge that stuff or to require a fix that leaves these working and then we fix the compilation error itself.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.