[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: End-of-line characters in long strings
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Fri, 18 Jan 2008 18:23:32 -0500
Roberto Ierusalimschy wrote:
>> Since the manual says that long strings "may contain anything except
>> a closing bracket of the proper level" and observing that even
>> embedded NUL characters are preserved, I expected embedded CRs to be
>> as well, which they are, except if they're followed by a LF. So,
>> should I interpret this that long strings may indeed contain
>> anything other than its closing bracket, but that CR-LF sequences,
>> while allowed, are lost? If so, perhaps this limitation should be
>> stated in the manual?
> Perhaps the manual could be even more rigid, stating that only text
> should be used inside literal strings? Even if Lua accepts them, it
> does not seem a good idea to have control characters floating in a
> source file.
For script source files it's probably not a good idea, but for datafiles
written in Lua (to take advantage of the Lua parser/interpreter) it
makes sense. There is a workaround with normal strings and escape
sequences, but that would be nice to let the option to the user to have
control characters in his text files.