aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/3rdParty/LuaMinify.h11
-rw-r--r--src/3rdParty/luaminify.lua5
2 files changed, 11 insertions, 5 deletions
diff --git a/src/3rdParty/LuaMinify.h b/src/3rdParty/LuaMinify.h
index 7ade925..f1f496f 100644
--- a/src/3rdParty/LuaMinify.h
+++ b/src/3rdParty/LuaMinify.h
@@ -45,7 +45,7 @@ local function PrintTable(tb, atIndent)
45 out = out..(useNewlines and baseIndent or '') 45 out = out..(useNewlines and baseIndent or '')
46 if type(k) == 'number' then 46 if type(k) == 'number' then
47 --nothing to do 47 --nothing to do
48 elseif type(k) == 'string' and k:match("^[A-Za-z_][A-Za-z0-9_]*$") then 48 elseif type(k) == 'string' and k:match("^[A-Za-z_][A-Za-z0-9_]*$") then
49 out = out..k.." = " 49 out = out..k.." = "
50 elseif type(k) == 'string' then 50 elseif type(k) == 'string' then
51 out = out.."[\""..k.."\"] = " 51 out = out.."[\""..k.."\"] = "
@@ -547,7 +547,7 @@ local function LexLua(src)
547 --get the initial char 547 --get the initial char
548 local thisLine = line 548 local thisLine = line
549 local thisChar = char 549 local thisChar = char
550 --local errorAt = ":"..line..":"..char..":> " 550 -- local errorAt = ":"..line..":"..char..":> "
551 local c = peek() 551 local c = peek()
552 552
553 --symbol to emit 553 --symbol to emit
@@ -1316,6 +1316,9 @@ R"lua_codes(
1316 if not tok:ConsumeKeyword('then', tokenList) then 1316 if not tok:ConsumeKeyword('then', tokenList) then
1317 return false, GenerateError("`then` expected.") 1317 return false, GenerateError("`then` expected.")
1318 end 1318 end
1319 if tok:IsSymbol(';') then
1320 tok:Get()
1321 end
1319 local st, nodeBody = ParseStatementList(scope) 1322 local st, nodeBody = ParseStatementList(scope)
1320 if not st then return false, nodeBody end 1323 if not st then return false, nodeBody end
1321 nodeIfStat.Clauses[#nodeIfStat.Clauses+1] = { 1324 nodeIfStat.Clauses[#nodeIfStat.Clauses+1] = {
@@ -1779,7 +1782,7 @@ local function Format_Mini(ast)
1779 --don't want to accidentally call last statement, can't join directly 1782 --don't want to accidentally call last statement, can't join directly
1780 return a..sep..b 1783 return a..sep..b
1781 else 1784 else
1782 --print("asdf", '"'..a..'"', '"'..b..'"') 1785 --print("asdf", '"'..a..'"', '"'..b..'"')
1783 return a..b 1786 return a..b
1784 end 1787 end
1785 end 1788 end
@@ -2470,7 +2473,7 @@ local function GetYueLineMap(luaCodes)
2470 local current = 1 2473 local current = 1
2471 local lastLine = 1 2474 local lastLine = 1
2472 local lineMap = { } 2475 local lineMap = { }
2473 for lineCode in luaCodes:gmatch("[^\n\r]*") do 2476 for lineCode in luaCodes:gmatch("([^\r\n]*)\r?\n?") do
2474 local num = lineCode:match("--%s*(%d+)%s*$") 2477 local num = lineCode:match("--%s*(%d+)%s*$")
2475 if num then 2478 if num then
2476 local line = tonumber(num) 2479 local line = tonumber(num)
diff --git a/src/3rdParty/luaminify.lua b/src/3rdParty/luaminify.lua
index 925af1e..d4389d7 100644
--- a/src/3rdParty/luaminify.lua
+++ b/src/3rdParty/luaminify.lua
@@ -1309,6 +1309,9 @@ local function ParseLua(src)
1309 if not tok:ConsumeKeyword('then', tokenList) then 1309 if not tok:ConsumeKeyword('then', tokenList) then
1310 return false, GenerateError("`then` expected.") 1310 return false, GenerateError("`then` expected.")
1311 end 1311 end
1312 if tok:IsSymbol(';') then
1313 tok:Get()
1314 end
1312 local st, nodeBody = ParseStatementList(scope) 1315 local st, nodeBody = ParseStatementList(scope)
1313 if not st then return false, nodeBody end 1316 if not st then return false, nodeBody end
1314 nodeIfStat.Clauses[#nodeIfStat.Clauses+1] = { 1317 nodeIfStat.Clauses[#nodeIfStat.Clauses+1] = {
@@ -2459,7 +2462,7 @@ local function GetYueLineMap(luaCodes)
2459 local current = 1 2462 local current = 1
2460 local lastLine = 1 2463 local lastLine = 1
2461 local lineMap = { } 2464 local lineMap = { }
2462 for lineCode in luaCodes:gmatch("[^\n\r]*") do 2465 for lineCode in luaCodes:gmatch("([^\r\n]*)\r?\n?") do
2463 local num = lineCode:match("--%s*(%d+)%s*$") 2466 local num = lineCode:match("--%s*(%d+)%s*$")
2464 if num then 2467 if num then
2465 local line = tonumber(num) 2468 local line = tonumber(num)