[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: "Juris Kalnins" <juris@...>
- Date: Mon, 12 Jul 2010 13:29:55 +0300
On Mon, 12 Jul 2010 03:50:56 +0300, Mark Hamburg <mark@grubmah.com> wrote:
It might be nice to increase the set of characters allowed in variable
names and/or sort out token filters so that if one wanted to do
something like make all globals be named with a $ at the front of their
name, one could. But that would be an individual choice with respect to
Lua usage.
One nice thing like those that you mention that one could want to do
if one wants to, say, simplify automatic generation of Lua code,
is adding support for tag-length-value tokens in the lexer.
For tag it is possible to use, e.g., some characters with code < ' ',
that currently are parse errors in Lua.
Tag can specify exactly if it is a global name, a local name or a string,
and having length (encoded in whatever way convenient)
allows to skip all the quoting/escaping and character set issues.
The required change to llex.c is small and trivial (and I have no trouble
porting it between Lua versions), but it would be interesting
to know if it is possible to make such "token filter" interface that:
- wouldn't slow down normal Lua.
- wouldn't complicate or increase Lua implementation.
- would allow such token filtering with comparable performance
without requiring changes in the core.