[perl #122951] [BUG] negative lookahead doesn't LTM properly
On Sat, 11 Oct 2014 05:05:48 -0700, pmichaud wrote: > 11:55r: say "abcde" ~~ / ab cde | ab.. / # LTM > fail > 11:55 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 cde | ab.. / ' 「abcd」
[perl #122951] [BUG] negative lookahead doesn't LTM properly
I added a test (fudged 'todo') to S05-metasyntax/longest-alternative.t with commit https://github.com/perl6/roast/commit/38931b20b4
[perl #122951] [BUG] negative lookahead doesn't LTM properly
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #122951] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/Ticket/Display.html?id=122951 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