On Tue Apr 28 07:44:46 2009, masak wrote:
> <masak> rakudo: grammar A { regex TOP { foo } }; A.parse("foo").say;
> say "bar"; A.parse("foo").print; say "bar"
> <p6eval> rakudo ae5e29: OUTPUT«foo␤bar␤bar␤»
> * masak submits rakudobug
> 
> Expected output: «foo␤bar␤foobar␤».

The problem here is that .print is conflicting with the pre-defined
<print> subrule for regexes (matching a printable character).  I'm not
quite sure how to resolve this.

There are quite a few workarounds, however:

  print(A.parse('foo'));
  A.parse('foo').Str.print;
  (~A.parse('foo')).print;

I'm not sure what the correct behavior should be here, so I'm converting
this ticket into a request to confirm/clarify the spec.

Thanks!

Pm


Reply via email to