lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Aka Lua Shoveitdownircsthroat

Here are a few tricks to minify Lua code:

"x,y,z=t[a],b,c end" -> "y,z,x=b,c,t[a]end" (you have to be careful with this one as it doesn't work with function calls and a few other things I think) "a = x; b = nil; c = nil;" -> "a,b,c=x" (heh :3 the more nils you have, the more space you save) if type(x)=="table"then -> if"table"==type(x)then (saves 1 char, and while shovingitdownircsthroat, every char counts) local print=print; local x,y -> local print,x,y=print; (saves a "local", the space between "local" and the identifiers gets replaced with a ",")

So would anyone like to write a Lua Shoveitdownircsthroat/Lua Minifier? :3

--
SoniEx2