SkillAgentSearch skills...

DumbLuaParser

Lua parsing library capable of optimizing and minifying code.

Install / Use

/learn @ReFreezed/DumbLuaParser

README

Dumb Lua Parser

Dumb Lua Parser is a library for tokenizing Lua code or creating ASTs (Abstract Syntax Trees) and converting the data back to Lua. It can also optimize and minify code.

The library is a single Lua file with no dependencies other than Lua itself. It works with Lua 5.1, 5.2, 5.3 and 5.4. LuaJIT should work too. MIT license.

Download the latest stable release here or, if you're cloning the repository, checkout the last commit with a version tag. Also available on LuaRocks.

Basic usage

local parser = require("dumbParser")

local tokens = parser.tokenizeFile("cool.lua")
local ast    = parser.parse(tokens)

parser.simplify(ast)
parser.printTree(ast)

local lua = parser.toLua(ast, true)
print(lua)

Check out examples.lua for some examples.

Documentation

See the website or the top of the source file.

Related Skills

View on GitHub
GitHub Stars38
CategoryDevelopment
Updated16d ago
Forks5

Languages

Lua

Security Score

95/100

Audited on Mar 15, 2026

No findings