pub enum ExpressionKind {
Show 14 variants
Identifier(String, Range<usize>),
Constant(Constant, Range<usize>),
StringLiteral(String, Range<usize>),
ArraySubscript {
array: Box<Expression>,
index: Box<Expression>,
span: Range<usize>,
},
FunctionCall {
function: Box<Expression>,
arguments: Vec<Expression>,
span: Range<usize>,
},
MemberAccess {
object: Box<Expression>,
member: String,
is_pointer: bool,
span: Range<usize>,
},
PostfixIncDec {
operand: Box<Expression>,
is_increment: bool,
span: Range<usize>,
},
PrefixIncDec {
operand: Box<Expression>,
is_increment: bool,
span: Range<usize>,
},
Unary {
operator: UnaryOperator,
operand: Box<Expression>,
span: Range<usize>,
},
Cast {
type_name: Box<TypeName>,
expression: Box<Expression>,
span: Range<usize>,
},
Binary {
left: Box<Expression>,
operator: BinaryOperator,
right: Box<Expression>,
span: Range<usize>,
},
Conditional {
condition: Box<Expression>,
then_expr: Box<Expression>,
else_expr: Box<Expression>,
span: Range<usize>,
},
Assignment {
left: Box<Expression>,
operator: AssignmentOperator,
right: Box<Expression>,
span: Range<usize>,
},
Comma {
expressions: Vec<Expression>,
span: Range<usize>,
},
}Expand description
Expression kind.
Variants§
Identifier(String, Range<usize>)
Identifier.
Constant(Constant, Range<usize>)
Constant (literal).
StringLiteral(String, Range<usize>)
String literal.
ArraySubscript
Array subscript array[index].
FunctionCall
Function call function(arguments).
Fields
§
function: Box<Expression>The function expression.
§
arguments: Vec<Expression>List of arguments.
MemberAccess
Member access object.member or object->member.
Fields
§
object: Box<Expression>The object expression.
PostfixIncDec
Postfix increment or decrement (++, --).
Fields
§
operand: Box<Expression>The operand.
PrefixIncDec
Prefix increment or decrement (++, --).
Fields
§
operand: Box<Expression>The operand.
Unary
Unary operation.
Cast
Type cast (type_name) expression.
Fields
§
expression: Box<Expression>The expression to cast.
Binary
Binary operation.
Fields
§
left: Box<Expression>Left operand.
§
operator: BinaryOperatorBinary operator.
§
right: Box<Expression>Right operand.
Conditional
Conditional expression condition ? then_expr : else_expr.
Fields
§
condition: Box<Expression>Condition.
§
then_expr: Box<Expression>Then expression.
§
else_expr: Box<Expression>Else expression.
Assignment
Assignment expression.
Fields
§
left: Box<Expression>Left side of assignment.
§
operator: AssignmentOperatorAssignment operator.
§
right: Box<Expression>Right side of assignment.
Comma
Comma expression expr1, expr2, ....
Implementations§
Trait Implementations§
Source§impl Clone for ExpressionKind
impl Clone for ExpressionKind
Source§fn clone(&self) -> ExpressionKind
fn clone(&self) -> ExpressionKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExpressionKind
impl Debug for ExpressionKind
Source§impl PartialEq for ExpressionKind
impl PartialEq for ExpressionKind
impl StructuralPartialEq for ExpressionKind
Auto Trait Implementations§
impl Freeze for ExpressionKind
impl RefUnwindSafe for ExpressionKind
impl Send for ExpressionKind
impl Sync for ExpressionKind
impl Unpin for ExpressionKind
impl UnwindSafe for ExpressionKind
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