unexpected symbol near '=' [FIXED]

So, this works:

local yy = -1, zz

But this fails with “unexpected symbol near ‘=’”

local yy = -1, zz = -1

It appears (I’ve only poked this for a few minutes) that there’s some issue with declaring multiple initialized local variables. More specifically, it looks like you can’t have more than one initialized variable per local declaration.

The second line is invalid Lua code.

Assignment in Lua does not return anything, so the trailing “= -1” is invalid syntax. If you want to declare and initialize multiple local variables on one line, do it like this:

local yy, zz = -1, -1

But… I… (stares hard at code. Stares hard at PIL. Stares back at code)…

Well foo, you’re right, of course. The PIL has a line that says “local a, b = 1, 10” and my perl-hindbrain saw three comma-separated parameters out of long habit… but “10” can’t be a variable, so meh.

Well, good; this seemed like a rather fundamental thing. I’d rather be wrong than have a bug, because me being wrong is easier to fix. :slight_smile:

No problem :slight_smile:

Generally any error messages like that are directly from the Lua interpreter, we only parse them to locate where to put them and make them look nice.