lua-users home
lua-l archive

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

Gé Weijers wrote:
On Sat, 2010-02-06 at 23:51 +0800, KHMan wrote:
And can the above be parsed as valid Lua syntax in any way?

If you build a lexical scanner the textbook way, using an FSA the
resulting scanner would not do this. It's not a big issue, but if you,
like the original poster, need to parse Lua without using the
parsing routines you end up scratching your head.

So, I guess there were engineering decisions that precluded a textbook implementation -- this is not uncommon in the canonical Lua implementation. Then again, EEs are used to using a lot of very quirky software and thus would just shrug at this. *shrug* :-)

I think in general, anyone who wants to mess with corner cases should know full well that they are playing with a lot of rope, in case they slip and hang themselves... :-) Lua assumes you're more interested in working with readable programs rather than in giving a code reviewer a splitting headache.

If a Lua coder doesn't feel safe with this, then they can use an editor that gives correct highlighting with such corner cases. SciTE works well, and if any Scintilla-based editor messes up with Lua syntax highlighting, ping their list and we will fix it.

It is also easy to write a new lexer from a written specification of llex.c, if one wants an independent exact implementation.

Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia