[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why does `load()` fail here?
- From: Coda Highland <chighland@...>
- Date: Fri, 22 Nov 2013 10:28:27 -0800
On Fri, Nov 22, 2013 at 10:26 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> code = "return '\n' "
>> =load(code)
> nil [string "return '..."]:1: unfinished string near '''
>
Because you didn't escape the backslash embedded in the string. It's
trying to parse this code:
return '
'
And of course that's not legal in Lua.
/s/ Adam