Skip Menu |
Report information
Id: 125690
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: moritz <moritz.lenz+perl [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Rakudo has stopped matching a regex, related to | vs. ||
To: rakudobug [...] perl.org
From: Moritz Lenz <moritz [...] faui2k3.org>
Date: Sat, 25 Jul 2015 21:02:48 +0200
Download (untitled) / with headers
text/plain 1.1k
This script here: # BEGIN SCRIPT my grammar PgTokenizer { token double_quote_normal { <-[\\"]>+ } token double_quote_escape { [\\ . ]+ } token double_quote { \" [ | <.double_quote_normal> | <.double_quote_escape> ]* \" } token single_quote_normal { <-['\\]>+ } token single_quote_escape { [ \'\' || \\ . ]+ } token single_quote { \' [ | <.single_quote_normal> | <.single_quote_escape> ]* \' } token placeholder { '?' } token normal { <-[?"']>+ } token TOP { ^ ( | <normal> | <placeholder> | <single_quote> | <double_quote> )* $ } } say PgTokenizer.parse(q['a\.b''cd?', "\"?", ?]) # END SCRIPT use to match successfully (and presumably did with 2015.06, otherwise we'd have had rakudo star test failures), but doesn't match anymore with rakudo 2015.07. If one changes the || to | in single_quote_escape, it matches again. I think this is a bug, because the two alternatives are mutually exclusive, and thus | vs || shouldn't matter.
Download (untitled) / with headers
text/plain 1.7k
On Sat Jul 25 12:03:18 2015, moritz wrote: Show quoted text
> This script here: > > # BEGIN SCRIPT > my grammar PgTokenizer { > token double_quote_normal { <-[\\"]>+ } > token double_quote_escape { [\\ . ]+ } > token double_quote { > \" > [ > | <.double_quote_normal> > | <.double_quote_escape> > ]* > \" > } > token single_quote_normal { <-['\\]>+ } > token single_quote_escape { [ \'\' || \\ . ]+ } > token single_quote { > \' > [ > | <.single_quote_normal> > | <.single_quote_escape> > ]* > \' > } > token placeholder { '?' } > token normal { <-[?"']>+ } > > token TOP { > ^ > ( > | <normal> > | <placeholder> > | <single_quote> > | <double_quote> > )* > $ > } > } > > say PgTokenizer.parse(q['a\.b''cd?', "\"?", ?]) > # END SCRIPT > > use to match successfully (and presumably did with 2015.06, otherwise > we'd have had rakudo star test failures), but doesn't match anymore with > rakudo 2015.07. > > If one changes the || to | in single_quote_escape, it matches again. > > I think this is a bug, because the two alternatives are mutually > exclusive, and thus | vs || shouldn't matter. >
For someone who has time to actually fix this in case I don't get to it: I bisected rakudo and got https://github.com/rakudo/rakudo/commit/d3785097e46b45eb51e1039c2e3f725dbdcfdf7b as the commit that introduced the change. Since this just bumps the NQP version, further bisection of nqp showed that https://github.com/perl6/nqp/commit/583419120b0ec9a3c2fef1a61e2993526fbebcd5 was the real culprit. that's all I've got for now. -Scott (PerlJam/perlpilot)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org