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

Owner: Nobody
Requestors: pmichaud <pmichaud [at] pobox.com>
Cc:
AdminCc:

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



Subject: [BUG] negative lookahead doesn't LTM properly
To: rakudobug [...] perl.org
From: "Patrick R. Michaud" <pmichaud [...] pobox.com>
Date: Sat, 11 Oct 2014 07:05:35 -0500
Download (untitled) / with headers
text/plain 515b
11:55 <pmichaud> r: say "abcde" ~~ / ab <![e]> cde | ab.. / # LTM fail 11:55 <camelia> rakudo-{parrot,moar} fd017a: OUTPUT«「abcd」␤␤» Correct should be "abcde", since he first alternation has a longer token to be matched. Per S05:2887: [...] So LTM completely ignores negative lookaheads, and continues to look for pure patterns in whatever follows the negative lookahead. You might say that positive lookaheads are opaque to LTM, but negative lookaheads are transparent to LTM. Pm
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 131b
I added a test (fudged 'todo') to S05-metasyntax/longest-alternative.t with commit https://github.com/perl6/roast/commit/38931b20b4
Download (untitled) / with headers
text/plain 763b
On Sat, 11 Oct 2014 05:05:48 -0700, pmichaud wrote: Show quoted text
> 11:55 <pmichaud> r: say "abcde" ~~ / ab <![e]> cde | ab.. / # LTM > fail > 11:55 <camelia> rakudo-{parrot,moar} fd017a: OUTPUT«「abcd」␤␤» > > Correct should be "abcde", since he first alternation has a longer > token to be matched. > > Per S05:2887: > > [...] So LTM completely ignores negative lookaheads, and > continues to look for pure patterns in whatever follows the negative > lookahead. You might say that positive lookaheads are opaque to LTM, > but negative lookaheads are transparent to LTM. > > Pm
Still broken in Rakudo version 2018.02-12-ge3c4db732 built on MoarVM version 2018.02 dogbert@dogbert-VirtualBox ~ $ perl6 -e 'say "abcde" ~~ / ab <![e]> cde | ab.. / ' 「abcd」


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