On Sun Jul 28 10:05:00 2013, masak wrote:
> <masak> r: grammar G { token TOP { ^<foo>$ }; rule foo { foo } }; say ?
> G.parse(" foo")
> <camelia> rakudo 96776b: OUTPUT«True␤»
> <masak> r: grammar G { token TOP { ^<foo>$ }; rule foo {foo } }; say ?
> G.parse(" foo")
> <camelia> rakudo 96776b: OUTPUT«False␤»
> <masak> I thought rules ignored initial whitespace...
> <moritz> masak: it's fascinating how rakudo still parses so well, being 
> built on Perl 6 rules... :-)
> <masak> heh.
> * masak does a search through RT first
> <masak> here is some discussion in a rejected ticket: 
> https://rt.perl.org/rt3/Ticket/Display.html?id=75668
> <masak> ah -- here: https://rt.perl.org/rt3/Ticket/Display.html?
> id=109874
> <masak> let's just add today's discussion to that one.


This significant whitespace has worked correctly for about half a year now in 
Rakudo. Additionally:

$ perl6 -e'grammar G { token TOP { ^<foo>$ }; rule foo { foo } }; say 
?G.parse(" foo")'
False
$ perl6 -e'grammar G { token TOP { ^<foo>$ }; rule foo { foo } }; say 
?G.parse("foo")'
True
$ perl6 -e'grammar G { rule TOP { ^ <foo> $ }; rule foo { foo } }; say 
?G.parse(" foo")'
True

These are the correct semantics. Marking this as resolved

Reply via email to