lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Jerome Vuarand wrote:
[...]
Lua lexer uses isalpha C function, therefore depending on the locale
some of the characters in 128-255 are already valid.

It shouldn't be! It should be using the C locale for all code-related parsing --- languages should never, ever, under *any* circumstances, change their behaviour depending on locale!

That way lies madness, with a perfectly valid program on one computer failing to run on another simply due to some user configuration setting. I've been burnt by this before. It's decidedly not fun.

You could change
it to allow all characters in 128-255 in addition to 'alpha' class and
underscore, but that would be a hack imho.

Of course! But it's a *useful* hack. We lose nothing by it, but gain functionality in other areas --- there are other ASCII-compatible encodings that this would work with, for example.

--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "They laughed at Newton. They laughed at Einstein. Of course, they
│ also laughed at Bozo the Clown." --- Carl Sagan