diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-09-27 18:22:50 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-09-27 18:22:50 +0800 |
| commit | b120e413d21a9d4d1961bb814dff88531a7a4855 (patch) | |
| tree | e599417c385ff00ac15c48d727a3588462972208 /src/ast.rs | |
| parent | 76af2f9a4a06140d7e00706817b59678c4468d1a (diff) | |
fix(parser): EndScope not preserved
chore(parser): simplify
Diffstat (limited to 'src/ast.rs')
| -rw-r--r-- | src/ast.rs | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1 +1,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 +} |
