From b120e413d21a9d4d1961bb814dff88531a7a4855 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 27 Sep 2025 18:22:50 +0800 Subject: fix(parser): EndScope not preserved chore(parser): simplify --- src/ast.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/ast.rs') diff --git a/src/ast.rs b/src/ast.rs index 8b13789..9777d4e 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -1 +1,27 @@ +use crate::parser::{self, Expr, ExprT, Scope}; +pub enum DepthExpr<'a> { + Decision { + cond: Box>, + t: Scope, + else_branch: Option>>, + }, + IO(&'a str), + Process(&'a str), +} + +fn parse(vec: Vec) -> Vec { + 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 +} -- cgit v1.2.3