Skip Menu |
Report information
Id: 72234
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

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



Subject: [BUG] Adding a double-colon "cut group" to the inside of a ratcheted expression causes it to backtrack in Rakudo
Date: Wed, 20 Jan 2010 16:42:45 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 863b
This be Rakudo db84bc on Parrot r43174. $ perl6 -e 'say "abab" ~~ / (ab)+: ab / || "no match"' no match $ perl6 -e 'say "abab" ~~ / (a :: b)+: ab / || "no match"' abab This is a PGE bug, but I don't know where else to submit PGE bugs, and they are expressed through Rakudo, so I'll submit it here. The first expression prints 'no match', and it should. This is because the ':' in the quantifier forbids the parenthesis group to backtrack into itself. It needs to backtrack into itself because it greedily ate both the 'ab' literals, when it should have saved one for dessert. The second expression should also print 'no match', for the exact same reasons. But it prints 'abab', which means it matches, which means it backtracks into the parenthesized submatch. It should do so no more than the first expression should -- adding '::' shouldn't change things.
Download (untitled) / with headers
text/plain 193b
on Kiev build second test doesn't match, but say :: is not implemented perl6 -e 'say "abab" ~~ / (a :: b)+: ab / || "no match"' ===SORRY!=== :: not yet implemented at line 1, near " b)+: ab /"
Download (untitled) / with headers
text/plain 167b
NOM: same error as on Kiev bbkr:nom bbkr$ ./perl6 -e 'say "abab" ~~ / (a :: b)+: ab / || "no match"' ===SORRY!=== :: not yet implemented at line 1, near " b)+: ab /"


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