Joseph F. Ryan wrote in perl.perl6.language :
> 
> If the final design stays the way it is now, there really won't be
> a "lexer".  Instead, a perl6 grammar parses the data, and builds up
> a huge match-object as it, well, matches.  This match object is then
> munged into the optree.

Oh, yes, I remember now. Thanks.

> This means the grammar probably won't be anything resembling simple,
> since it has to act as both a lexer and a parser at the same time.
> However, that's not to say your hack couldn't work; in fact, it would
> be easy to implement during the match-object-munging phase.

Indeed.

> However, it still treats C<if> as special syntax, which is the real issue
> at hand..
> 
> I question whether treating C<if> as a function rather than as built-in
> syntax will make the parser any simpler if "special block rules" keep
> getting added to simply make it work.  I'm in favor of keeping a few
> "special blocks" if it makes things easier to implement/design in the
> long run.

Makes sense. Note that I'm not advocating "elsif", quite an horrible
keyword, that I still mispell as "elseif" sometimes. But I like hacking
on grammars ;-)

Reply via email to