# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #123452]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123452 >


<masak> star: grammar G { regex TOP { [<x> [';' | $$] \s*]* }; token x
{ B | \s* <y> \s* '()'* }; regex y { A | B } }; my $s = "B\nA();"; say
?G.parse($s)
<camelia> star-{m,p} 2014.09: OUTPUT«False␤»
<masak> star: use Grammar::Tracer; grammar G { regex TOP { [<x> [';' |
$$] \s*]* }; token x { B | \s* <y> \s* '()'* }; regex y { A | B } };
my $s = "B\nA();"; say ?G.parse($s)
<camelia> star-{m,p} 2014.09: OUTPUT«TOP␤|  x␤|  * MATCH "B"␤|  x␤|  |
 y␤|  |  * MATCH "A"␤|  * MATCH "A()"␤|  x␤| |  y␤|  |  * FAIL␤|  *
FA…»
<masak> aww, the output cuts off too early to show that the grammar succeeds :/
* masak makes a gist
<masak> https://gist.github.com/masak/d10db42d5c6fd6d8d906
<vendethiel> masak: is it deterministicly undeterministic?
<masak> yes.
<masak> personally, I think it should succeed even without
Grammar::Tracer. (and that that's the bug)
<masak> but the fact that it comes out different with and without is
*clearly* wrong.
* masak submits rakudobug
<masak> things that cause the problem to go away: inlining y into x.
inlining x into TOP. removing any of the remaining \s*. removing the *
after '()'.

Reply via email to