develooper Front page | perl.perl6.language | Postings from April 2006

Re: [svn:perl6-synopsis] r8883 - doc/trunk/design/syn

Thread Previous | Thread Next
From:
Patrick R. Michaud
Date:
April 20, 2006 11:15
Subject:
Re: [svn:perl6-synopsis] r8883 - doc/trunk/design/syn
Message ID:
20060420181441.GA26588@host.pmichaud.com
On Thu, Apr 20, 2006 at 09:19:48AM -0700, Larry Wall wrote:
> : > +Any other value causes the match to fail.  In particular, shorter keys
> : > +are not tried if a longer one matches and fails.
> : 
> : Is there a way to say to continue with the next shortest key?
> 
> Yeah, use <@rules> rather than <%tokens>.  :)
> 
> Actually, how about we say that '' just succeeds, and a number says to
> retry ignoring keys longer than the number?

s/retry/continue trying/, perhaps?

Using '' (instead of 1) as the success value sounds Good, since 
null string always matches following a key.  Taking "ignoring keys
longer than the number" literally, would we also read this then 
that returning 0 tries the (remaining) empty keys of each hash, 
and returning -1 fails the matching of <%tokens>?

> [ discussion of unbalanced <( ... )>
> I'm inclined to say that the conservative thing is to require balance.
> We could relax it later, I suppose.

Works for me.

> : > +Just as C<rx> has variants, so does the C<rule> declarator.
> : > +In particular, there are two special variants for use in grammars:
> : > +C<token> and C<parse>.
> : 
> : I agree with Audrey that C<parse> is probably too useful in other
> : contexts.  C<token:w> works fine for me.
> 
> Aesthetically, I hate :w, actually...and the whole point of naming "token"
> is that it is *not* a normal parser rule, but a lexer rule.
> 
> But I agree that "parse" is probably the wrong word.  Earlier versions
> had "prod" (short for "production") or "words".  

Two other ideas (from a short walk)... how about something along
the lines of "phrase" or "sequence"?  

Pm

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About