~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
RESOLVED FIXED
Submitter
~andreyorst
Assigned to
No-one
Submitted
1 year, 1 month ago
Updated
3 months ago
Labels
bug

~technomancy REPORTED FIXED 3 months ago

I think this was fixed in 5c94c7fe07b3c8901976a8521bff913a6b96cb0d.

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