Crate lua_semantics

Source
Expand description
// type of `lua_parser::Block`
let block = lua_parser::parse_str( ... )?;

// semantic analysis, and generate enhanced AST for later use.
let enhanced_ast = lua_semantics::process(block)?;

Structs§

Block
block of statements. return statement must be optionally placed at the end of the block.
Context
ExprBinaryData
Internal data for binary operation
ExprFunctionCall
function call. prefix(args) or prefix:method(args).
ExprFunctionObject
ExprTableConstructor
table constructor, a list of fields
ExprTableIndex
table[index], table.index
ExprUnaryData
Internal data for unary operation
FunctionDefinition
constructing function. not a function object.
LabelInfo
label information.
ReturnStatement
return statement
ScopeBlock
ScopeFunction
StmtAssignment
l0, l1, l2 = r0, r1, r2. variadic ... cannot be used in lhs
StmtFor
for statement with start, end, step.
StmtForGeneric
for statement with generic expressions.
StmtGoto
Goto statement
StmtIf
if statement
StmtLabel
Goto statement
StmtLocalDeclaration
local variable declaration.
StmtRepeat
repeat statement
StmtWhile
while statement
VariableInfo

Enums§

Attrib
local variable attribute. either const or close.
ExprBinary
binary operation. lhs OP rhs
ExprLocalVariable
ExprUnary
unary operation. OP x
Expression
lua value & expression
IntOrFloat
Lua’s numeric representation, can be either integer or float.
ProcessError
Scope
Statement
lua statement

Functions§

process
perform semantic analysis on the given block and generate enhanced AST.

Type Aliases§

FloatType
type alias for lua float type.
IntType
type alias for lua integer type.
StmtFunctionCall
function call statement.