# New Ticket Created by  Paweł Pabian 
# Please include the string:  [perl #75634]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75634 >


[16:25] <bbkr> rakudo: grammar X { token TOP { <ws>+ } }; X.parse(" "); # why 
it goes into infinite loop (despite the fact that + is not necessary) ?
[16:25] <p6eval> rakudo a54677:  ( no output )
[16:25] <bbkr> known bug?
[16:26] <masak> haven't seen it before, no.
[16:26] <jnthn> Me either.
[16:26] * bbkr reports
[16:26] <jnthn> I guess since <ws> can match nothing, it can also match 
nothing a lot of times. ;-)
[16:27] <masak> that might explain it.
[16:27] <masak> so maybe it's expected behavior.
[16:27] <masak> maybe even something that merits a warning from the compiler.
[16:27] <masak> if someone does <ws>+ with the standard <ws> rule, they get 
a "you probably don't mean that" warning.
[16:27] <bbkr> rakudo: grammar X { token TOP { ""+ } }; X.parse(" "); # looks 
like jnthn i right
[16:28] <p6eval> rakudo a54677:  ( no output )
[16:28] <-- jaldhar_ has left this server (Remote host closed the connection).
[16:28] <masak> rakudo: " " ~~ / [ '' ]+ /; say 'alive'
[16:28] <p6eval> rakudo a54677:  ( no output )
[16:28] <jnthn> Ah, *any* zero-width match seems to exhibit it.
[16:29] <jnthn> That probably is a bug.
[16:29] <masak> no, it's not.
[16:29] <masak> think about it. it's expected behavior.
[16:29] <jnthn> rakudo: " " ~~ / [ x? ]+ /; say 'alive'
[16:29] <masak> regexes are *expected* to do this.
[16:29] <p6eval> rakudo a54677:  ( no output )
[16:29] <masak> I have a plan for letting GGE detect these things, though.
[16:29] <masak> it tends to bite people.
[16:30] <masak> I also seem to recall that with a Thompson engine, you can't 
even think that kind of wrong thought. ;)
[16:30] <jnthn> masak: It's inconsistent with Perl 5.
[16:30] <jnthn> C:\>perl -e "' ' =~ /(x?)+/; print 42;"
[16:30] <jnthn> 42
[16:30] <masak> oh?
[16:30] <masak> then it probably merits pmichaud's and TimToady's attention.

Reply via email to