pub enum Expression {
Show 14 variants
Integer {
value: i64,
position: Position,
},
Float {
value: f64,
position: Position,
},
String {
value: String,
position: Position,
},
Boolean {
value: bool,
position: Position,
},
Null {
position: Position,
},
Identifier {
name: String,
position: Position,
},
Binary {
left: Box<Expression>,
operator: BinaryOp,
right: Box<Expression>,
position: Position,
},
Unary {
operator: UnaryOp,
operand: Box<Expression>,
position: Position,
},
Assignment {
name: String,
value: Box<Expression>,
position: Position,
},
Call {
function: String,
arguments: Vec<Expression>,
position: Position,
},
MethodCall {
receiver: Box<Expression>,
method: String,
arguments: Vec<Expression>,
position: Position,
},
Grouped {
expression: Box<Expression>,
position: Position,
},
ArrayLiteral {
elements: Vec<Expression>,
position: Position,
},
DictionaryLiteral {
pairs: Vec<(Expression, Expression)>,
position: Position,
},
}Expand description
An expression in FiddlerScript.
Variants§
Integer
Integer literal: 42
Float
Float literal: 3.14
String
String literal: "hello"
Boolean
Boolean literal: true or false
Null
Null literal: null
Identifier
Variable reference: x
Binary
Binary operation: a + b
Unary
Unary operation: -x or !x
Fields
§
operand: Box<Expression>The operand expression
Assignment
Assignment: x = value
Fields
§
value: Box<Expression>The value expression
Call
Function call: foo(args)
Fields
§
arguments: Vec<Expression>The argument expressions
MethodCall
Method call: expr.method(args)
Fields
§
receiver: Box<Expression>The receiver expression (object the method is called on)
§
arguments: Vec<Expression>The argument expressions
Grouped
Grouped expression: (expr)
ArrayLiteral
Array literal: [1, 2, 3]
DictionaryLiteral
Dictionary literal: {"key": value, "another": 42}
Fields
§
pairs: Vec<(Expression, Expression)>Key-value pairs where keys are string expressions
Implementations§
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
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 Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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