Expand description
Typed AST for Lua 5.5 — shared by parser, transformer, and code generator.
Also houses LuaTarget, the cross-cutting compilation-target enum used by
both valua-lint and valua-codegen. Placing it here avoids an illegal
valua-lint → valua-codegen dependency (see architectural note in PRD §6.2).
Structs§
- Assign
- Simple or multi-target assignment:
targets = values. - Block
- Root node: a sequence of statements followed by an optional return.
- Do
do … endblock.- ElseIf
- One
elseif cond then bodybranch. - Function
Body - Shared representation for anonymous and named function bodies.
- Function
Decl function name.path:method (params) body end- Function
Name - Dotted function name with optional method receiver:
a.b.c:method. - Generic
For for namelist in exprlist do body end- Goto
goto label- If
if cond then body [elseif …]* [else …] end- Label
::label::- Local
Decl local varlist [<attr>] [= exprlist]- Local
Function Decl local function name (params) body end- Local
Name - One name in a local declaration, with its optional attribute.
- Numeric
For for i = start, limit [, step] do body end- Param
- One parameter in a function signature.
- Repeat
repeat body until cond- Return
return [exprlist]- Table
Constructor { field, field, … }- While
while cond do body end
Enums§
- Attribute
- Lua 5.4/5.5 variable attributes.
- Binary
Op - Binary operators in Lua 5.5 (includes bitwise and integer division).
- Call
- A function-call expression or method-call expression.
- Expression
- All expression forms in Lua 5.5.
- LuaTarget
- Target Lua runtime — controls which built-ins and polyfills are assumed available.
- Statement
- Every kind of statement in Lua 5.5 (Lua 5.4 is a fully supported subset).
- Table
Field - One field in a table constructor.
- UnaryOp
- Unary operators in Lua 5.5.