On Tue, 2005-04-26 at 13:24, Luke Palmer wrote:

> [we'll] redo label syntax later if we must.


Well, of course you run the danger of making it hard for people to
recognize labels which are otherwise common across many languages, but
here's a few ways you could do labels if you need to:

The real problem is that you're using a trailing glyph to identify what
is essentially a type, so you could introduce a leading glyph:

        rx/: <identifier> <ws>+ ( <statement> | <control> ) /

Is there ever a reason for a leading adverb in a statement or control
structure?

or you could have a keyword that introduces the label:

        rx/label <ws>+ <identifier> <ws>+ (<statement>|<control>)/

or you could use some kind of trickery:

        rx/label : $/

note that this means that we're making a newline part of the syntax,
which might feel "too python" to folks (especially where it ends in a
":"), but it would leave you with very P5 looking labels:

        LINE:
        while =<> -> $line {
                CHAR:
                for split('',$line) -> $char {
                        next CHAR if $char eq ' ';
                        next LINE if $char eq '#';
                }
        }

Of course, let leaves you not able to do:

        method:
                args;

And I'm not even going to start on the "if it's the same column"
thing... ;-)

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to