pub enum DartExpr {
Show 24 variants
Lit(DartLit),
Var(String),
Field(Box<DartExpr>, String),
MethodCall(Box<DartExpr>, String, Vec<DartExpr>),
Call(Box<DartExpr>, Vec<DartExpr>),
New(String, Option<String>, Vec<DartExpr>),
ListLit(Vec<DartExpr>),
MapLit(Vec<(DartExpr, DartExpr)>),
SetLit(Vec<DartExpr>),
Lambda(Vec<(DartType, String)>, Box<DartExpr>),
Arrow(Vec<(DartType, String)>, Box<DartExpr>),
BinOp(Box<DartExpr>, String, Box<DartExpr>),
UnaryOp(String, Box<DartExpr>),
Ternary(Box<DartExpr>, Box<DartExpr>, Box<DartExpr>),
NullAware(Box<DartExpr>, String),
NullCoalesce(Box<DartExpr>, Box<DartExpr>),
Cascade(Box<DartExpr>, String, Vec<DartExpr>),
Await(Box<DartExpr>),
As(Box<DartExpr>, DartType),
Is(Box<DartExpr>, DartType),
Throw(Box<DartExpr>),
Spread(Box<DartExpr>),
Index(Box<DartExpr>, Box<DartExpr>),
Raw(String),
}Expand description
Dart expression AST.
Variants§
Lit(DartLit)
Literal value
Var(String)
Variable reference
Field(Box<DartExpr>, String)
Property access: expr.field
MethodCall(Box<DartExpr>, String, Vec<DartExpr>)
Method call: expr.method(args)
Call(Box<DartExpr>, Vec<DartExpr>)
Static / free function call: name(args)
New(String, Option<String>, Vec<DartExpr>)
Constructor call: ClassName(args) or ClassName.named(args)
ListLit(Vec<DartExpr>)
List literal: [e1, e2, ...]
MapLit(Vec<(DartExpr, DartExpr)>)
Map literal: {k1: v1, k2: v2, ...}
SetLit(Vec<DartExpr>)
Set literal: {e1, e2, ...}
Lambda(Vec<(DartType, String)>, Box<DartExpr>)
Anonymous function: (params) { body } or (params) => expr
Arrow(Vec<(DartType, String)>, Box<DartExpr>)
Arrow function: (params) => expr
BinOp(Box<DartExpr>, String, Box<DartExpr>)
Binary operation: left op right
UnaryOp(String, Box<DartExpr>)
Unary operation: op expr
Ternary(Box<DartExpr>, Box<DartExpr>, Box<DartExpr>)
Conditional / ternary: cond ? then : else
NullAware(Box<DartExpr>, String)
Null-aware access: expr?.field
NullCoalesce(Box<DartExpr>, Box<DartExpr>)
Null coalescing: expr ?? fallback
Cascade(Box<DartExpr>, String, Vec<DartExpr>)
Cascade: expr..method(args)
Await(Box<DartExpr>)
await expr
As(Box<DartExpr>, DartType)
Type cast: expr as Type
Is(Box<DartExpr>, DartType)
Type check: expr is Type
Throw(Box<DartExpr>)
throw expr
Spread(Box<DartExpr>)
Spread in list/map: ...expr
Index(Box<DartExpr>, Box<DartExpr>)
Index access: expr[index]
Raw(String)
Raw Dart snippet (for runtime helpers)
Trait Implementations§
impl StructuralPartialEq for DartExpr
Auto Trait Implementations§
impl Freeze for DartExpr
impl RefUnwindSafe for DartExpr
impl Send for DartExpr
impl Sync for DartExpr
impl Unpin for DartExpr
impl UnsafeUnpin for DartExpr
impl UnwindSafe for DartExpr
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