[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Announce] Alpha release of a Lua debugger
- From: Thomas Lauer <thomas.lauer@...>
- Date: Fri, 13 Apr 2007 17:58:37 +0100
Rici Lake <firstname.lastname@example.org> wrote:
> Sorry, that came out much snottier than I intended.
No offense taken. You just stated the obvious.
> For example, rather than make 'continue' a actual keyword in
> the lexer, you can leave it as a TK_NAME and do a special case
> recognition in the parser. It only needs to be checked when a
> statement is expected, and since it must be a block ender, it can
> only be followed by 'end', 'else'. 'elseif', 'until' and ';'.
I thought about that possibility but decided not to go down that route,
mainly because I wanted to minimise the local changes I would need to
apply once a new version of lua comes out.
I am still experimenting with these additional features anyway: perhaps
I change keywords or find another way. One rather sketchy idea would be
to dynamically switch the relevant parser bits between full lua
compatibility and extensions enabled. In this way I could use external
modules and still switch on extended features in my own code. One big
problem with that would be source code generated on the fly. We'll see.
In the end I am pragmatic: if a feature is nice but too troublesome to
implement (or maintain) I'll skip it. And for the time being poking
around the compiler internals does provide good fun and some insights.
> Looked at from another perspective, the use of barewords as
> table keys is completely syntactically separate from their
> use as keywords.
Indeed. I found that slightly irritating but what the heck. Lexer and
parser are such nice and (relatively) simple beasts...