On Sat, Apr 07, 2007 at 11:20:19AM -0700, Jim McKim wrote:
> The problematic grammar:
> 
> grammar x_grammar;
> 
> #token h_digits { <:i[0-9a-f]>+ }
> #token h_digits { <[0-9a-f]> }
> 
> token TOK_CONSTANT {
>         #<h_digits> ( : <h_digits> )**{1..15}
>         <h_digits> : <h_digits>
> }


The error (that PGE is having difficulty catching) is
that the cut operator (':') isn't being applied to any
particular term in:

    #<h_digits> ( : <h_digits> )**{1..15}

So, when PGE sees the ':' cut operator, it attempts to
apply it to the previous pattern and there's not anything
there to apply it to, at which point PGE chokes.  PGE should 
report a more useful exception here.

Note that the leading # does not comment out the entire line
in this case -- since # is followed by an opening '<' bracket
character, the comment terminates with the closing '>' bracket [1]
and not at the end of the line.

So, I'll take this ticket as being that PGE needs to
better recognize when a 'cut' token is being applied to
a null term and report the error accordingly.

Thanks!

Pm

[1] http://dev.perl.org/perl6/doc/design/syn/S05.html#New_metacharacters

Reply via email to