prometheus-lua / Prometheus

Lua Obfuscator written in pure Lua
https://levno-710.gitbook.io/prometheus/
GNU Affero General Public License v3.0
202 stars 60 forks source link

[BUG] goto not supported #151

Closed Vaxood closed 10 months ago

Vaxood commented 10 months ago

input.lua

local function vaxod()

    if true then 
        goto v 
    end 
    ::v:: 
end

err :

←[0m←[33mPROMETHEUS: No config was specified, falling back to Minify preset←[0m
←[0m←[35mPROMETHEUS: ←[0mApplying Obfuscation Pipeline to input.lua ...
←[0m←[35mPROMETHEUS: ←[0mParsing ...
←[0m←[31mPROMETHEUS: Parsing Error at Position 7:12, unexpected token <Identifier> "v", expected <Symbol> "="←[0m
lua: src\logger.lua:54: Parsing Error at Position 7:12, unexpected token <Identifier> "v", expected <Symbol> "="
stack traceback:
        [C]: in function 'error'
        src\logger.lua:54: in function 'errorCallback'
        src\logger.lua:57: in function 'error'
        src\prometheus\parser.lua:134: in function 'expect'
        src\prometheus\parser.lua:472: in function 'statement'
        src\prometheus\parser.lua:171: in function 'block'
        src\prometheus\parser.lua:249: in function 'statement'
        src\prometheus\parser.lua:171: in function 'block'
        src\prometheus\parser.lua:314: in function 'statement'
        src\prometheus\parser.lua:171: in function 'block'
        src\prometheus\parser.lua:149: in function 'parse'
        src\prometheus\pipeline.lua:178: in function 'apply'
        src\cli.lua:202: in main chunk
        [C]: in function 'require'
        cli.lua:12: in main chunk
        [C]: ?
    version : LuaU and Lua51
levno-710 commented 10 months ago

Prometheus currently only support Lua 5.1 completely. Adding goto would need a slight rewrite of the parser + compiler. Related to #62 (Lua 5.2+ Support)