summaryrefslogtreecommitdiff
path: root/src/ast.rs
blob: 9777d4e9ae0174556e248d1188520e51d8e5c258 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::parser::{self, Expr, ExprT, Scope};

pub enum DepthExpr<'a> {
    Decision {
        cond: Box<DepthExpr<'a>>,
        t: Scope,
        else_branch: Option<Box<DepthExpr<'a>>>,
    },
    IO(&'a str),
    Process(&'a str),
}

fn parse(vec: Vec<Expr>) -> Vec<DepthExpr> {
    let exprs = Vec::new();

    let mut it = vec
        .iter()
        .peekable();

    while let Some(e) = it.next() {
        if let ExprT::Decision((cond, scope)) = e.expr {
            let cond = parser::parse(cond);
        }
    }

    exprs
}