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


This code works in Rakudo rev 32970:

   grammar GrammarOne { token foo { 'foo' }; }
   grammar GrammarTwo { token foobar { <GrammarOne::foo> 'bar' }; }
   'foobar' ~~ GrammarTwo::foobar or die 'failed one-level namespace  
grammar';

But this code does dies:

   grammar Grammar::A { token foo { 'foo' }; }
   grammar Grammar::B { token foobar { <Grammar::A::foo> 'bar' }; }
   'foobar' ~~ Grammar::B::foobar or die 'failed two-level namespace  
grammar';

The attached patch fixes the latter problem.  The patch changes the  
implementation of !keyword_grammar to be much more like ! 
keyword_class, which has had more recent attention.  If this patch is  
applied, I recommend that somebody do the analogous work for ! 
keyword_role too.

  guts.pir |   12 ++----------
  1 files changed, 2 insertions(+), 10 deletions(-)


Attachment: grammar_namespace.patch
Description: Binary data


Reply via email to