pub enum LuaStmt {
Show 15 variants
Assign {
targets: Vec<LuaExpr>,
values: Vec<LuaExpr>,
},
LocalAssign {
names: Vec<String>,
attribs: Vec<Option<String>>,
values: Vec<LuaExpr>,
},
Do(Vec<LuaStmt>),
While {
cond: LuaExpr,
body: Vec<LuaStmt>,
},
Repeat {
body: Vec<LuaStmt>,
cond: LuaExpr,
},
If {
cond: LuaExpr,
then_body: Vec<LuaStmt>,
elseif_clauses: Vec<(LuaExpr, Vec<LuaStmt>)>,
else_body: Option<Vec<LuaStmt>>,
},
For {
var: String,
start: LuaExpr,
limit: LuaExpr,
step: Option<LuaExpr>,
body: Vec<LuaStmt>,
},
ForIn {
names: Vec<String>,
exprs: Vec<LuaExpr>,
body: Vec<LuaStmt>,
},
Function(LuaFunction),
Local(LuaFunction),
Return(Vec<LuaExpr>),
Break,
Goto(String),
Label(String),
Call(LuaExpr),
}Expand description
Lua statement AST node.
Variants§
Assign
Assignment: targets = values
LocalAssign
Local variable declaration: local names = values
Do(Vec<LuaStmt>)
Do block: do ... end
While
While loop: while cond do ... end
Repeat
Repeat-until loop: repeat ... until cond
If
If-elseif-else: if cond then ... [elseif ...] [else ...] end
Fields
For
Numeric for: for var = start, limit[, step] do ... end
ForIn
Generic for: for names in exprs do ... end
Function(LuaFunction)
Named function definition: function name(params) ... end
Local(LuaFunction)
Local function definition: local function name(params) ... end
Return(Vec<LuaExpr>)
Return statement: return [exprs]
Break
Break statement: break
Goto(String)
Goto statement: goto label
Label(String)
Label statement: ::label::
Call(LuaExpr)
Expression statement (function call): expr
Trait Implementations§
impl StructuralPartialEq for LuaStmt
Auto Trait Implementations§
impl Freeze for LuaStmt
impl RefUnwindSafe for LuaStmt
impl Send for LuaStmt
impl Sync for LuaStmt
impl Unpin for LuaStmt
impl UnsafeUnpin for LuaStmt
impl UnwindSafe for LuaStmt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more