LuaMinify
LuaMinify copied to clipboard
Lua source code minifier.
I was using **Minify.lua** to make a in game linter, but for some reason, it doesn't detect ends on different lines. So basically, it will underline my for loop as...
On linux the file system is case sensitive. This makes line 11 in `ParseLua.lua` break. To fix this, change `require ('Strict')` to `require ('strict')`
when minifying, 1 of the 10's of times I've minified, I got an error. Seems like it may have been due to a protected keyword used as a variable name....
given: `local a = {} local _ = a[ [[foo]]]` The source code will clump the brackets together to form `[[[foo]]]` (a syntax error) instead of `[ [[foo]]]`
Also added some escape thing for the index concatenation You could replace `pairs` to `next` too, but I'm not sure if the lib cares about `getmetatable(tbl).__pairs`.
_ENV: - Is a local in the top level scope - Should never be renamed I've hackily fixed this, but I imagine someone who knows the structure of the code...
Instead of sometimes getting to 7 letter long variable names while only using a couple 1 letter ones, It now does it in perfect order with maximum efficiency, aka "a...
At least on Windows I had to patch the files to get it running like this: `C:\some\path\LuaMinify some_file.lua`
( + a upper/lowercase fix for linux) Bug examples: local a=1 --
I don't know if this project is still alive... But I did some code cleaning of this. And there is much more todo but I will send in a first...