cortex_lang/preprocessing/ast/
statement.rs

1use super::{expression::{RExpression, RIdentExpression}, function::RInterpretedBody};
2
3pub enum RStatement {
4    Expression(RExpression),
5    Throw(RExpression),
6    VariableDeclaration {
7        name: String,
8        is_const: bool,
9        initial_value: RExpression,
10    },
11    Assignment {
12        name: RIdentExpression,
13        value: RExpression,
14    },
15    WhileLoop(RConditionBody),
16}
17
18pub struct RConditionBody {
19    pub(crate) condition: RExpression,
20    pub(crate) body: RInterpretedBody,
21}
22impl RConditionBody {
23    pub fn new(condition: RExpression, body: RInterpretedBody) -> Self {
24        RConditionBody {
25            condition,
26            body,
27        }
28    }
29}