pub enum Expr {
Show 16 variants
Nil,
True,
False,
Vararg,
Int(i64),
Float(f64),
Str(Vec<u8>),
Name(Name),
Index {
obj: ExprId,
key: ExprId,
},
Call {
func: ExprId,
args: Vec<ExprId>,
line: u32,
},
MethodCall {
obj: ExprId,
method: Name,
args: Vec<ExprId>,
line: u32,
},
Function(FuncBody),
Table {
fields: Vec<TableField>,
line: u32,
},
BinOp {
op: BinOp,
lhs: ExprId,
rhs: ExprId,
line: u32,
},
UnOp {
op: UnOp,
operand: ExprId,
line: u32,
},
Paren(ExprId),
}Expand description
Expression kinds — produces a Lua value when evaluated.
Variants§
Nil
nil literal.
True
true literal.
False
false literal.
Vararg
... vararg expression (legal only inside a vararg function).
Int(i64)
Integer literal.
Float(f64)
Floating-point literal.
Str(Vec<u8>)
String literal (raw bytes — Lua strings are 8-bit clean).
Name(Name)
Identifier reference (resolved later to local / upvalue / global).
Index
obj.key and obj[key] (dot keys become string-literal keys).
Call
func(args) function call.
Fields
MethodCall
obj:method(args) method call (passes obj as implicit first arg).
Fields
Function(FuncBody)
function ... end function literal.
Table
{ ... } table constructor.
BinOp
Binary operator expression.
Fields
UnOp
Unary operator expression.
Paren(ExprId)
Parenthesized expression: truncates multiple results to one.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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