handle an ambiguity case for generated code

This commit is contained in:
leaf corcoran 2012-01-14 03:05:42 -08:00
parent 260b17a878
commit b4d6f59d04
2 changed files with 4 additions and 2 deletions

View File

@ -274,7 +274,8 @@ Block = (function()
_insert_breaks = function(self) _insert_breaks = function(self)
for i = 1, #self._lines - 1 do for i = 1, #self._lines - 1 do
local left, right = self._lines[i], self._lines[i + 1] 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] .. ";" self._lines[i] = self._lines[i] .. ";"
end end
end end

View File

@ -186,7 +186,8 @@ class Block
_insert_breaks: => _insert_breaks: =>
for i = 1, #@_lines - 1 for i = 1, #@_lines - 1
left, right = @_lines[i], @_lines[i+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]..";" @_lines[i] = @_lines[i]..";"
render: => render: =>