Skip Menu |

This queue is for tickets about the Babble CPAN distribution.

Report information
The Basics
Id: 126285
Status: open
Priority: 0/
Queue: Babble

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.090001
  • 0.090002
  • 0.090003
Fixed in: (no value)



Subject: Regexp related test failures (0.090001, 0.090002)
With newer perls (5.18 and newer) the test suite fails: ... Sequence (?_...) not recognized in regex; marked by <-- HERE in m/(?(DEFINE) (?<PerlSubroutineDeclaration>(?<PerlWrapperSubroutineDeclaration_001>(?&PerlBabbleInnerMatch)|(?&PerlStdSubroutineDeclaration))) (?<PerlBabbleInnerMatch>(?<PerlWrapperBabbleInnerMatch_001>((?&PerlStdBabbleInnerMatch))(?{ push @Babble::Match::F, [ pos() - length($^N), length($^N) ] }))) (?<PerlStdBabbleInnerMatch>sub \b (?&PerlOWS) (?&PerlOldQualifiedIdentifier)(?:(?: (?&PerlOWS) (?>(?&PerlAttributes)) )?+(?&PerlOWS) (?&PerlParent at (eval 35) line 1671. t/plugin-coresignatures.t ....... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run ... etc ...
RT-Send-CC: arc [...] cpan.org
The bug seems to be in perl itself, due to the changes in the way regexes handle closures (Aaron says so). Attached a patch (essentially, stringify the whole new grammar before recompiling it). The patch also fixes a "unescaped left brace" in a test.
Subject: babble.patch
diff --git c/lib/Babble/Grammar.pm w/lib/Babble/Grammar.pm index a31aa5d..4972719 100644 --- c/lib/Babble/Grammar.pm +++ w/lib/Babble/Grammar.pm @@ -32,7 +32,9 @@ lazy grammar_regexp => sub { return $base_re unless @parts; my $define_block = join "\n", '(?(DEFINE)', '', @parts, '', ')'; use re 'eval'; - return qr{${define_block} ${base_re}}x; + my $r = "${define_block} ${base_re}"; + my $x = qr{$r}x; + return $x; }; sub _rule_name { diff --git c/lib/Babble/Match.pm w/lib/Babble/Match.pm index c87b690..7ffdf46 100644 --- c/lib/Babble/Match.pm +++ w/lib/Babble/Match.pm @@ -82,7 +82,7 @@ sub match_positions_of { our @F; my $wrapped = $self->grammar->clone->extend_rule( $of => sub { '('.$_[0].')'.'(?{ push @Babble::Match::F, [ pos() - length($^N), length($^N) ] })' } - )->grammar_regexp; + )->grammar_regexp; my @found = do { local @F; local $_ = $self->text; diff --git c/t/plugin-state.t w/t/plugin-state.t index 5d8c20d..afcacf0 100644 --- c/t/plugin-state.t +++ w/t/plugin-state.t @@ -16,7 +16,7 @@ my @cand = ( push @cand, map { (my $orig = $_->[0]) =~ s/^my \$foo = sub/sub foo/; - s/^my \$foo = do //, s/sub {/sub foo {/ for (my $expect = $_->[1]); + s/^my \$foo = do //, s/sub \{/sub foo {/ for (my $expect = $_->[1]); [ $orig, $expect ], } @cand;
On Fri Aug 17 08:27:12 2018, DAKKAR wrote: Show quoted text
> The bug seems to be in perl itself, due to the changes in the way > regexes handle closures (Aaron says so). > > Attached a patch (essentially, stringify the whole new grammar before > recompiling it). > The patch also fixes a "unescaped left brace" in a test.
I don't understand this at all but I've shipped an 006 which will hopefully fix it. Made the changes manually since for some reason your editor decided to misalign a random paren and that got included in the patch. Not marking resolved yet because I'd like to wait for cpantesters in case of further stupidity on my part.
RT-Send-CC: arc [...] cpan.org
On 2018-08-19 07:05:34, MSTROUT wrote: Show quoted text
> On Fri Aug 17 08:27:12 2018, DAKKAR wrote:
> > The bug seems to be in perl itself, due to the changes in the way > > regexes handle closures (Aaron says so). > > > > Attached a patch (essentially, stringify the whole new grammar before > > recompiling it). > > The patch also fixes a "unescaped left brace" in a test.
> > I don't understand this at all but I've shipped an 006 which will > hopefully fix it. > > Made the changes manually since for some reason your editor decided to > misalign a random paren and that got included in the patch. > > Not marking resolved yet because I'd like to wait for cpantesters in > case of further stupidity on my part.
It looks better now (with 0.090006), but with perl 5.26+ there's still a regexp related failure: ... Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^{ <-- HERE \s*my\s*(\([^\)]+\))\s*=\s*\@_\s*;/ at /home/cpansand/.cpan/build/2018081913/Babble-0.090006-2/blib/lib/Babble/Plugin/Sigify.pm line 12. Compilation failed in require at t/plugin-sigify.t line 3. BEGIN failed--compilation aborted at t/plugin-sigify.t line 3. t/plugin-sigify.t ............... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run ...
Malleted a couple more possibly rogue unescaped { characters and shipped 007