diff options
Diffstat (limited to '')
| -rw-r--r-- | src/3rdParty/luaminify.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/3rdParty/luaminify.lua b/src/3rdParty/luaminify.lua index 7f770ca..925af1e 100644 --- a/src/3rdParty/luaminify.lua +++ b/src/3rdParty/luaminify.lua | |||
| @@ -1737,6 +1737,12 @@ local function Format_Mini(ast) | |||
| 1737 | return a.."\n"..b | 1737 | return a.."\n"..b |
| 1738 | end]] | 1738 | end]] |
| 1739 | sep = sep or ' ' | 1739 | sep = sep or ' ' |
| 1740 | if sep == ';' then | ||
| 1741 | local token = a:match("([%w_]+)%s*$") | ||
| 1742 | if token == "then" or token == "do" then | ||
| 1743 | sep = ' ' | ||
| 1744 | end | ||
| 1745 | end | ||
| 1740 | local aa, bb = a:sub(-1,-1), b:sub(1,1) | 1746 | local aa, bb = a:sub(-1,-1), b:sub(1,1) |
| 1741 | if UpperChars[aa] or LowerChars[aa] or aa == '_' then | 1747 | if UpperChars[aa] or LowerChars[aa] or aa == '_' then |
| 1742 | if not (UpperChars[bb] or LowerChars[bb] or bb == '_' or Digits[bb]) then | 1748 | if not (UpperChars[bb] or LowerChars[bb] or bb == '_' or Digits[bb]) then |
| @@ -2094,9 +2100,15 @@ local function FormatYue(ast, lineMap) | |||
| 2094 | break | 2100 | break |
| 2095 | end | 2101 | end |
| 2096 | end | 2102 | end |
| 2103 | aa = aa or '' | ||
| 2097 | sep = sep or ' ' | 2104 | sep = sep or ' ' |
| 2098 | if spaceSep then | 2105 | if spaceSep then |
| 2099 | sep = '' | 2106 | sep = '' |
| 2107 | elseif sep == ';' then | ||
| 2108 | local token = aa:match("([%w_]+)%s*$") | ||
| 2109 | if token == "then" or token == "do" then | ||
| 2110 | sep = ' ' | ||
| 2111 | end | ||
| 2100 | end | 2112 | end |
| 2101 | local bb = b:match("^%s*([^%s])") | 2113 | local bb = b:match("^%s*([^%s])") |
| 2102 | if UpperChars[aa] or LowerChars[aa] or aa == '_' then | 2114 | if UpperChars[aa] or LowerChars[aa] or aa == '_' then |
