pub enum StatementNode {
Expression(ExpressionNode),
MethodDef {
name: String,
params: Vec<String>,
body: Vec<StatementNode>,
},
ClassDef {
name: String,
superclass: Option<String>,
body: Vec<StatementNode>,
},
Assignment {
target: String,
value: ExpressionNode,
},
If {
condition: ExpressionNode,
then_body: Vec<StatementNode>,
else_body: Option<Vec<StatementNode>>,
},
While {
condition: ExpressionNode,
body: Vec<StatementNode>,
},
Return(Option<ExpressionNode>),
}Expand description
Ruby 语句节点
Variants§
Expression(ExpressionNode)
表达式语句
MethodDef
方法定义
ClassDef
类定义
Assignment
赋值语句
If
条件语句
Fields
§
condition: ExpressionNode§
then_body: Vec<StatementNode>§
else_body: Option<Vec<StatementNode>>While
循环语句
Return(Option<ExpressionNode>)
返回语句
Trait Implementations§
Source§impl Clone for StatementNode
impl Clone for StatementNode
Source§fn clone(&self) -> StatementNode
fn clone(&self) -> StatementNode
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 StatementNode
impl Debug for StatementNode
Source§impl PartialEq for StatementNode
impl PartialEq for StatementNode
impl StructuralPartialEq for StatementNode
Auto Trait Implementations§
impl Freeze for StatementNode
impl RefUnwindSafe for StatementNode
impl Send for StatementNode
impl Sync for StatementNode
impl Unpin for StatementNode
impl UnwindSafe for StatementNode
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