pub enum ExprKind {
Show 31 variants
Int(i64),
Float(f64),
Unit {
value: String,
unit: String,
},
Str(Vec<StrSeg>),
RawStr(String),
Text(String),
Content {
kind: String,
id: String,
},
Tag(String),
Bool(bool),
None,
Ident(String),
SelfValue,
It,
Mc(VersionCond),
Tuple(Vec<Expr>),
List(Vec<Expr>),
Map(Vec<(Expr, Expr)>),
Lambda {
params: Vec<Name>,
body: Vec<Stmt>,
},
Unary {
op: UnOp,
expr: Box<Expr>,
},
Binary {
op: BinOp,
left: Box<Expr>,
right: Box<Expr>,
},
Range {
from: Box<Expr>,
to: Box<Expr>,
inclusive: bool,
},
Is {
expr: Box<Expr>,
ty: Type,
bind: Option<Name>,
negated: bool,
},
As {
expr: Box<Expr>,
ty: Type,
checked: bool,
},
Call {
callee: Box<Expr>,
args: Vec<Arg>,
},
Index {
expr: Box<Expr>,
index: Box<Expr>,
},
TypeArgs {
expr: Box<Expr>,
args: Vec<Type>,
},
Member {
expr: Box<Expr>,
name: Name,
safe: bool,
},
If {
cond: Box<Cond>,
then: Block,
otherwise: Option<Box<Expr>>,
},
Match {
expr: Box<Expr>,
arms: Vec<Arm>,
},
Block(Block),
Error,
}Variants§
Int(i64)
Float(f64)
Unit
Str(Vec<StrSeg>)
RawStr(String)
Text(String)
Content
Tag(String)
Bool(bool)
None
Ident(String)
SelfValue
It
Mc(VersionCond)
mc >= 1.21: the running game’s version.
Tuple(Vec<Expr>)
List(Vec<Expr>)
Map(Vec<(Expr, Expr)>)
Lambda
Unary
Binary
Range
Is
x is T, x is T name, x !is T.
As
x as T, x as? T.
Call
Index
TypeArgs
f<T, U> before a call: the type arguments.
Member
x.name, x?.name.
If
Match
Block(Block)
Error
What couldn’t be parsed (reported already).
Trait Implementations§
impl StructuralPartialEq for ExprKind
Auto Trait Implementations§
impl Freeze for ExprKind
impl RefUnwindSafe for ExprKind
impl Send for ExprKind
impl Sync for ExprKind
impl Unpin for ExprKind
impl UnsafeUnpin for ExprKind
impl UnwindSafe for ExprKind
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