pub enum Expr {
Show 21 variants
Missing,
Literal(Literal),
Name(SmolStr),
SelfExpr,
Super,
Bin {
op: BinOp,
lhs: ExprId,
rhs: ExprId,
},
Unary {
op: UnOp,
operand: ExprId,
},
Ternary {
cond: ExprId,
then_branch: ExprId,
else_branch: ExprId,
},
Call {
callee: ExprId,
args: Vec<ExprId>,
},
Field {
receiver: ExprId,
name: SmolStr,
name_range: TextRange,
},
Index {
base: ExprId,
index: ExprId,
},
Is {
operand: ExprId,
ty: Option<AstPtr>,
negated: bool,
},
Cast {
operand: ExprId,
ty: Option<AstPtr>,
},
In {
lhs: ExprId,
rhs: ExprId,
negated: bool,
},
Await(ExprId),
Array(Vec<ExprId>),
Dict(Vec<(ExprId, Option<ExprId>)>),
Lambda {
params: Vec<ParamBinding>,
body: Block,
},
Preload {
arg: Option<ExprId>,
path: Option<SmolStr>,
},
GetNode {
path: Option<SmolStr>,
unique: bool,
},
Paren(ExprId),
}Expand description
A lowered expression. Children are referenced by ExprId.
Variants§
Missing
An unlowerable / recovered expression (typed Error, suppresses cascade).
Literal(Literal)
A literal.
Name(SmolStr)
A bare identifier reference.
SelfExpr
self.
Super
super.
Bin
A binary expression.
Unary
A prefix unary expression.
Ternary
a if c else b.
Fields
Call
callee(args…).
Field
receiver.name.
Fields
Index
base[index].
Is
operand is [not] T — always bool; narrows on the true branch.
Fields
Cast
operand as T — optimistic downcast to T.
In
lhs [not] in rhs — always bool.
Await(ExprId)
await operand.
Array(Vec<ExprId>)
[a, b, …].
Dict(Vec<(ExprId, Option<ExprId>)>)
{ k: v, … } (value is None only on recovery).
Lambda
func(...): … — an anonymous function (typed Callable).
Preload
preload(path) — a compile-time resource reference. When path is a constant string
literal (the only form Godot accepts), it is captured here so inference can resolve it to
the declaring file’s ScriptRef (M3); a non-literal argument leaves path None (the
seam).
Fields
GetNode
$Path / %Unique / get_node("…") — a node-path access. In Phase 2 this was always
Object(Node); Phase-4 M1 resolves the literal path against the owning scene to the node’s
concrete type. A computed get_node(var) keeps path: None (stays Node, never warns).
Fields
Paren(ExprId)
(inner).
Trait Implementations§
impl Eq for Expr
impl StructuralPartialEq for Expr
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.