[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Backslash-newline escape as a line continuation rather than a newline?
- From: Miles Bader <miles@...>
- Date: Fri, 09 Apr 2010 10:10:45 +0900
Luiz Henrique de Figueiredo <firstname.lastname@example.org> writes:
>> Couldn't the lexer recognize any instance of two string-enclosing
>> sequences around a concatenation operator? (This would also result in the
>> ability to avoid constant folding by putting parentheses around a string.)
> This was discussed last time as well. This solution requires unbounded
> lookahead (and is a parser task, not a lexical task). Consider
> a= ("hello".."world".."from".."Lua")
> a= ("hello".."world".."from".._VERSION)
Wait, why is that different than
Couldn't Lua's lexer, while reading a "-delimited string, just
squash an embedded "<ws>..<ws>" sequence without the parser ever
even knowing about it (where <ws> means [ \t\n])...?
You can put limits on <ws> and just say "this lexer optimization is
only done when the source code is within the stated limits; anything
else is just left as separate strings and an explicit concatenation
Quack, n. A murderer without a license.