mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
handle an ambiguity case for generated code
This commit is contained in:
parent
260b17a878
commit
b4d6f59d04
@ -274,7 +274,8 @@ Block = (function()
|
||||
_insert_breaks = function(self)
|
||||
for i = 1, #self._lines - 1 do
|
||||
local left, right = self._lines[i], self._lines[i + 1]
|
||||
if left:sub(-1) == ")" and right:sub(1, 1) == "(" then
|
||||
local lc = left:sub(-1)
|
||||
if (lc == ")" or lc == "]") and right:sub(1, 1) == "(" then
|
||||
self._lines[i] = self._lines[i] .. ";"
|
||||
end
|
||||
end
|
||||
|
@ -186,7 +186,8 @@ class Block
|
||||
_insert_breaks: =>
|
||||
for i = 1, #@_lines - 1
|
||||
left, right = @_lines[i], @_lines[i+1]
|
||||
if left\sub(-1) == ")" and right\sub(1,1) == "("
|
||||
lc = left\sub(-1)
|
||||
if (lc == ")" or lc == "]") and right\sub(1,1) == "("
|
||||
@_lines[i] = @_lines[i]..";"
|
||||
|
||||
render: =>
|
||||
|
Loading…
Reference in New Issue
Block a user