pub enum Expr {
Show 17 variants
Ident(Identifier),
Atom {
value: String,
span: Range<usize>,
},
Number {
value: String,
span: Range<usize>,
},
String {
value: String,
span: Range<usize>,
},
Bool {
value: bool,
span: Range<usize>,
},
Unary {
op: ElixirTokenType,
expr: Box<Expr>,
span: Range<usize>,
},
Binary {
left: Box<Expr>,
op: ElixirTokenType,
right: Box<Expr>,
span: Range<usize>,
},
Match {
left: Box<Expr>,
right: Box<Expr>,
span: Range<usize>,
},
Call {
callee: Box<Expr>,
args: Vec<Expr>,
span: Range<usize>,
},
Field {
receiver: Box<Expr>,
field: Identifier,
span: Range<usize>,
},
Attribute {
name: Identifier,
span: Range<usize>,
},
Index {
receiver: Box<Expr>,
index: Box<Expr>,
span: Range<usize>,
},
Paren {
expr: Box<Expr>,
span: Range<usize>,
},
List {
items: Vec<Expr>,
span: Range<usize>,
},
Tuple {
items: Vec<Expr>,
span: Range<usize>,
},
Map {
items: Vec<Expr>,
span: Range<usize>,
},
Block(Block),
}Expand description
Represents an expression in the Elixir AST.
An expression is a unit of code that produces a value when evaluated.
Variants§
Ident(Identifier)
An identifier expression.
Atom
An atom literal.
Fields
Number
A numeric literal.
Fields
String
A string literal.
Fields
Bool
A boolean literal.
Fields
Unary
A unary expression.
Fields
§
op: ElixirTokenTypeThe unary operator.
Binary
A binary expression.
Fields
§
op: ElixirTokenTypeThe binary operator.
Match
A pattern match expression.
Fields
Call
A function call expression.
Fields
Field
A field access expression.
Fields
§
field: IdentifierThe field being accessed.
Attribute
A module attribute expression.
Fields
§
name: IdentifierThe name of the attribute.
Index
An index access expression.
Fields
Paren
A parenthesized expression.
Fields
List
A list literal.
Fields
Tuple
A tuple literal.
Fields
Map
A map literal.
Fields
Block(Block)
A block expression.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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> 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