diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-11-27 14:28:39 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-11-27 14:28:39 +0800 |
| commit | 1288432c7cb5db2aff4fd6cf46ee8d8442913046 (patch) | |
| tree | cf64cc7f07da1224fd4fc7a0b04659e629a0a37e /src/3rdParty/lua | |
| parent | cd827731ca155f198d26b61a0965469560e1bb34 (diff) | |
| download | yuescript-1288432c7cb5db2aff4fd6cf46ee8d8442913046.tar.gz yuescript-1288432c7cb5db2aff4fd6cf46ee8d8442913046.tar.bz2 yuescript-1288432c7cb5db2aff4fd6cf46ee8d8442913046.zip | |
fix luaminify issue.
Diffstat (limited to '')
| -rw-r--r-- | src/3rdParty/luaminify.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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) |
