statements in rust
This commit is contained in:
parent
15b331f447
commit
a629ddca05
6 changed files with 434 additions and 194 deletions
13
rust/rox/src/statement.rs
Normal file
13
rust/rox/src/statement.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use crate::{expression::Expression, token::Token};
|
||||
|
||||
/// Enumeration of all types of statements.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Statement {
|
||||
Block(Vec<Statement>),
|
||||
Print(Expression),
|
||||
Expression(Expression),
|
||||
Var {
|
||||
name: Token,
|
||||
initializer: Box<Option<Expression>>,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue