~technomancy/fennel#52: 
Illegal semicolons can be emitted at the beginning of functions

Looks like https://git.sr.ht/~technomancy/fennel/commit/3ffd391d7fa3e774056555abd53156bb535d0c39#src/fennel/compiler.fnl is not compatible with LuaJIT in all cases. The following code:

(fn x [y] 
  (y.obj:method) 
  y)

will compile to something like:

local function x(y)
  ; (y.obj):method()
  return y
end

LuaJIT treats the semicolon in that position as illegal. (In my limited testing, Lua 5.2 and up appear to accept it.)

This is blocking me from using 0.9.0.

Status
RESOLVED FIXED
Submitter
~jeremypenner
Assigned to
No-one
Submitted
5 months ago
Updated
5 months ago
Labels
No labels applied.

~technomancy 5 months ago

I pushed a fix for this in 163ab94 that checks to see if it's the first element in the chunk, but I'm not 100% confident of it. I'll test it across a few other codebases but if we find trouble we can bring back the do/end solution.

~technomancy REPORTED FIXED 5 months ago

This is fixed and released in 0.9.1; I think the fix should do the trick. I've tested it across all of the codebases I have in https://git.sr.ht/~technomancy/fennel-compendium and haven't found any trouble.

Register here or Log in to comment, or comment via email.