[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Curiosity of decimal numbers followed by concatenation
- From: Gé Weijers <ge@...>
- Date: Sat, 06 Feb 2010 20:17:42 -0800
On Sat, 2010-02-06 at 23:51 +0800, KHMan wrote:
> > 220.127.116.11.5e+say_cheese
> And can the above be parsed as valid Lua syntax in any way?
Of course not, but it's still strange that this whole construct is fed
into a conversion routine as a single 'number'.
My contention is that a sequence like "1...e" should ideally be parsed
as "1. .. e", which is perfectly valid Lua. The lexer currently groups
"1...e" together as a "number" and concludes it's invalid because strtod
or a similar conversion routine does not like it.
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.