~technomancy/fennel#128: 
comment forms that contain ]] break when compiled

The following code:

(comment
 (let [[a b] [1 2]]
   (+ a b)))

When compiled produces Lua code that is not syntactically valid:

--[[ (let [[a b] [1 2]] (+ a b)) ]]
return nil

I believe comment should check if its body contains the delimiter, and use [=[ syntax ]=] instead.

This even breaks with strings:

-- (comment "]]")
--[[ "]]" ]]
return nil
Status
REPORTED
Submitter
~andreyorst
Assigned to
No-one
Submitted
3 months ago
Updated
3 months ago
Labels
bug