Skip to main content

Crate valua_ast

Crate valua_ast 

Source
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 … end block.
ElseIf
One elseif cond then body branch.
FunctionBody
Shared representation for anonymous and named function bodies.
FunctionDecl
function name.path:method (params) body end
FunctionName
Dotted function name with optional method receiver: a.b.c:method.
GenericFor
for namelist in exprlist do body end
Goto
goto label
If
if cond then body [elseif …]* [else …] end
Label
::label::
LocalDecl
local varlist [<attr>] [= exprlist]
LocalFunctionDecl
local function name (params) body end
LocalName
One name in a local declaration, with its optional attribute.
NumericFor
for i = start, limit [, step] do body end
Param
One parameter in a function signature.
Repeat
repeat body until cond
Return
return [exprlist]
TableConstructor
{ field, field, … }
While
while cond do body end

Enums§

Attribute
Lua 5.4/5.5 variable attributes.
BinaryOp
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).
TableField
One field in a table constructor.
UnaryOp
Unary operators in Lua 5.5.