A modern, fully featured Luau parser written entirely in Luau
Fully strict-typing with the New Type Solver and optimized for high performance.
Only compatibles with New Type Solver.
A complete port of Parser.cpp providing both AST (Abstract Syntax Tree) & CST (Concrete Syntax Tree).
To stay true to the original implementation, the CST does not include low-level trivia such as whitespace.
This Luau parser is primarily intended for plugin development and for building Luau compilers or tooling.
It provides detailed syntax through both AST and CST, making it well suited for advanced language tooling such as linters, formatters, highlighter, refactoring tools, or even a full luau compiler/transpiler.
This parser is fast because it uses a simple singleton-style procedural design. It just resets its internal variables and runs, avoiding the overhead of more complex architectures.
local Parser = require(path.to.LuauParser)
local success, result = Parser.parse('const foo: (string, ...number) -> (...any) = 123i')
if success then
print(result.root) -- do anything you want
else
warn(result.errors)
end