@eryx/luau Module

Luau source code parser, compiler, type checker, and AST query library.

This is the unified @eryx/luau facade. It re-exports all sub-modules under a single table:

Sub-modules can also be required individually as @eryx/luau/parse, @eryx/luau/analysis, etc.

local luau = require("@eryx/luau")

-- Parse source into an AST
local result = luau.parse.parse(source, { captureComments = true })
for _, stat in result.root.body do
    print(stat.type, stat.location.beginline)
end

-- Type check
local checked = luau.analysis.check(source, { mode = "strict", annotate = true })
print(checked.annotated)

-- Compile and run
local fn = luau.vm.load(source, "=example")
fn()