FPtje / GLuaFixer

Linter for Garry's mod Lua.
https://fptje.github.io/glualint-web/
GNU Lesser General Public License v2.1
142 stars 19 forks source link

Beautifying makes function fail syntax #155

Closed Yogpod closed 1 year ago

Yogpod commented 1 year ago

If I beautify

r=function(...)((...))[...]=nil;end

then it will give me

r = function(...)
    ...[...] = nil
end

which does not work because of the missing parenthesis and yes this came from an obfuscator again

I can just set "prettyprint_removeRedundantParens" to false in the config but it doesn't seem redundant if it causes a syntax error without them

Also this syntax fails, should I make a separate issue for it:

local a = {}
local b = {1}

(a)[1] = b[1]
(a)[2] = 0x1
FPtje commented 1 year ago

Oh wow, more examples. Do people obfuscate code specifically against glualint? 😅

Thanks for reporting though. I'll take a look when I get the chance.

Yogpod commented 1 year ago

Oh wow, more examples. Do people obfuscate code specifically against glualint? 😅

Yeah that and I think just lua linters in general to make it more difficult to reverse the code