lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Philippe,

> I'm not sure why it's causing an error, but it seems like a problem
> with wxlua.CompileLuaScript() that doesn't recognize shebangs
> (ZeroBrane Studio doesn't modify the shebang in any way, it just
> styles it, which hides # and makes the font larger). I'll see if there
> is an alternative or a fix for this.

I just did a bit of testing and it seems like shebang is not
recognized by loadstring() either:

local ok, err = loadstring([[#!lua
print("123")
]])
print(ok, err)

prints "nil     [string "#!lua..."]:1: unexpected symbol near '#'"

loadfile() handles shebang fine though. I'll probably switch from
wxlua.CompileLuaScript() to loadfile().

Paul.