# New Ticket Created by Tyler Curtis # Please include the string: [perl #77022] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=77022 >
[1:38pm] tylercurtis: rakudo: grammar Foo { token TOP { 'b' } }; say Foo.parse('abc').Bool; # this is right [1:38pm] p6eval: rakudo 19931f: OUTPUT«0» [1:38pm] tylercurtis: rakudo: grammar Foo { token TOP { 'b' } }; say Foo.parse('bc').Bool; # I don't think this is. [1:38pm] p6eval: rakudo 19931f: OUTPUT«1» [1:38pm] tylercurtis: rakudo: grammar Foo { token TOP { 'b' } }; say Foo.parse('ab').Bool; # Also right. [1:38pm] p6eval: rakudo 19931f: OUTPUT«0» [1:39pm] tylercurtis: Grammar.parse seems to anchor to the beginning of the string but not to the end. If I correctly understand the behavior of Grammar.parse and regex methods, only "b" should match the Foo grammar above because regex methods are automatically anchored to the beginning and end of the string when called directly as Grammar.parse should do with Foo.TOP. -- Tyler Curtis