Fixed moonscript generating ambiguous lua after import when the next line starts with (

This commit is contained in:
Nathan DECHER 2020-04-30 23:35:24 +02:00 committed by leaf
parent aad0d2a0f6
commit 494387236e
2 changed files with 2 additions and 4 deletions

View File

@ -94,8 +94,7 @@ do
end
insert(buffer, l)
if "string" == type(self[i + 1]) then
local lc = l:sub(-1)
if (lc == ")" or lc == "]") and self[i + 1]:sub(1, 1) == "(" then
if l:sub(-1) ~= ',' and l:sub(-3) ~= 'end' and self[i + 1]:sub(1, 1) == "(" then
insert(buffer, ";")
end
end

View File

@ -71,8 +71,7 @@ class Lines
-- insert breaks between ambiguous statements
if "string" == type @[i + 1]
lc = l\sub(-1)
if (lc == ")" or lc == "]") and @[i + 1]\sub(1,1) == "("
if l\sub(-1)!=',' and l\sub(-3)!='end' and @[i + 1]\sub(1,1) == "("
insert buffer, ";"
insert buffer, "\n"