|
Gé Weijers wrote:
On Sat, 2010-02-06 at 23:51 +0800, KHMan wrote:1.2.3.4.5e+say_cheeseAnd can the above be parsed as valid Lua syntax in any way?[snip] 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 lua.org 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.
-- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia