[perl #122951] [BUG] negative lookahead doesn't LTM properly
[email protected] ("Jan-Olof Hendig via RT") Wed, 21 Feb 2018 05:49:26 -0800
| Newsgroups | perl.perl6.compiler |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 11 Oct 2014 05:05:48 -0700, pmichaud wrote:
> 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」