pub enum LuaExpr {
Show 16 variants
Nil,
True,
False,
Int(i64),
Float(f64),
Str(String),
Var(String),
BinOp {
op: String,
lhs: Box<LuaExpr>,
rhs: Box<LuaExpr>,
},
UnaryOp {
op: String,
operand: Box<LuaExpr>,
},
Call {
func: Box<LuaExpr>,
args: Vec<LuaExpr>,
},
MethodCall {
obj: Box<LuaExpr>,
method: String,
args: Vec<LuaExpr>,
},
TableConstructor(Vec<LuaTableField>),
IndexAccess {
table: Box<LuaExpr>,
key: Box<LuaExpr>,
},
FieldAccess {
table: Box<LuaExpr>,
field: String,
},
Lambda {
params: Vec<String>,
vararg: bool,
body: Vec<LuaStmt>,
},
Ellipsis,
}Expand description
Lua expression AST node.
Variants§
Nil
nil
True
true
False
false
Int(i64)
Integer literal: 42
Float(f64)
Float literal: 3.14
Str(String)
String literal: "hello"
Var(String)
Variable reference: x
BinOp
Binary operation: lhs op rhs
UnaryOp
Unary operation: op operand
Call
Function call: func(args)
MethodCall
Method call: obj:method(args)
TableConstructor(Vec<LuaTableField>)
Table constructor: {field, ...}
IndexAccess
Index access: table[key]
FieldAccess
Field access: table.field
Lambda
Lambda (anonymous function): function(params) body end
Ellipsis
Vararg expression: ...
Trait Implementations§
impl StructuralPartialEq for LuaExpr
Auto Trait Implementations§
impl Freeze for LuaExpr
impl RefUnwindSafe for LuaExpr
impl Send for LuaExpr
impl Sync for LuaExpr
impl Unpin for LuaExpr
impl UnsafeUnpin for LuaExpr
impl UnwindSafe for LuaExpr
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