mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
Fixed moonscript generating ambiguous lua after import
when the next line starts with (
This commit is contained in:
parent
aad0d2a0f6
commit
494387236e
@ -94,8 +94,7 @@ do
|
|||||||
end
|
end
|
||||||
insert(buffer, l)
|
insert(buffer, l)
|
||||||
if "string" == type(self[i + 1]) then
|
if "string" == type(self[i + 1]) then
|
||||||
local lc = l:sub(-1)
|
if l:sub(-1) ~= ',' and l:sub(-3) ~= 'end' and self[i + 1]:sub(1, 1) == "(" then
|
||||||
if (lc == ")" or lc == "]") and self[i + 1]:sub(1, 1) == "(" then
|
|
||||||
insert(buffer, ";")
|
insert(buffer, ";")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -71,8 +71,7 @@ class Lines
|
|||||||
|
|
||||||
-- insert breaks between ambiguous statements
|
-- insert breaks between ambiguous statements
|
||||||
if "string" == type @[i + 1]
|
if "string" == type @[i + 1]
|
||||||
lc = l\sub(-1)
|
if l\sub(-1)!=',' and l\sub(-3)!='end' and @[i + 1]\sub(1,1) == "("
|
||||||
if (lc == ")" or lc == "]") and @[i + 1]\sub(1,1) == "("
|
|
||||||
insert buffer, ";"
|
insert buffer, ";"
|
||||||
|
|
||||||
insert buffer, "\n"
|
insert buffer, "\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user