pub enum ExpressionNode {
Identifier {
name: String,
span: Range<usize>,
},
Literal(LiteralNode),
MethodCall {
receiver: Option<Box<ExpressionNode>>,
method: String,
args: Vec<ExpressionNode>,
span: Range<usize>,
},
BinaryOp {
left: Box<ExpressionNode>,
operator: String,
right: Box<ExpressionNode>,
span: Range<usize>,
},
UnaryOp {
operator: String,
operand: Box<ExpressionNode>,
span: Range<usize>,
},
Array {
elements: Vec<ExpressionNode>,
span: Range<usize>,
},
Hash {
pairs: Vec<(ExpressionNode, ExpressionNode)>,
span: Range<usize>,
},
}Expand description
Ruby 表达式节点
Variants§
Identifier
标识符
Literal(LiteralNode)
字面量
MethodCall
方法调用
BinaryOp
二元操作
UnaryOp
一元操作
Array
数组
Hash
哈希
Trait Implementations§
Source§impl Clone for ExpressionNode
impl Clone for ExpressionNode
Source§fn clone(&self) -> ExpressionNode
fn clone(&self) -> ExpressionNode
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 ExpressionNode
impl Debug for ExpressionNode
Source§impl<'de> Deserialize<'de> for ExpressionNode
impl<'de> Deserialize<'de> for ExpressionNode
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
Source§impl PartialEq for ExpressionNode
impl PartialEq for ExpressionNode
Source§impl Serialize for ExpressionNode
impl Serialize for ExpressionNode
impl StructuralPartialEq for ExpressionNode
Auto Trait Implementations§
impl Freeze for ExpressionNode
impl RefUnwindSafe for ExpressionNode
impl Send for ExpressionNode
impl Sync for ExpressionNode
impl Unpin for ExpressionNode
impl UnwindSafe for ExpressionNode
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