pub enum Statement {
Expression {
expr: Box<Node<Expression>>,
},
Declaration {
var: Rc<Variable>,
},
Assignment {
var: Rc<Variable>,
expr: Box<Node<Expression>>,
},
If {
cond: Box<Node<Expression>>,
on_true: Box<Node<Statement>>,
on_false: Option<Box<Node<Statement>>>,
},
While {
cond: Box<Node<Expression>>,
body: Box<Node<Statement>>,
},
Return {
expr: Option<Box<Node<Expression>>>,
},
Compound {
stmts: Vec<Node<Statement>>,
},
}
Variants
Expression
Fields
Declaration
Fields
Assignment
Fields
If
Fields
While
Fields
Return
Fields
Compound
Fields
Trait Implementations
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Formats the value using the given formatter.