diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-05 22:07:38 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-05 22:07:38 +0800 |
| commit | dac1ae7fbc73d44274fe77e4c74cdac9bb0d440e (patch) | |
| tree | bf6709a067525e9999a13e20d3739b329ae257d4 | |
| parent | f6e4972fd1b62d962d514ba9641ae19fcc5549d9 (diff) | |
ast: more sensible Decision::cond data type
| -rw-r--r-- | src/ast.rs | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -6,7 +6,7 @@ use crate::parser::{Expr, ExprT, Metadata, Scope}; #[derive(Clone, Debug)] pub enum DepthExpr<'a> { Decision { - cond: Box<DepthExpr<'a>>, + cond: Box<&'a str>, // TODO: take DepthExpr t: Scope, then_branch: Box<Vec<DepthExpr<'a>>>, else_branch: Option<Box<Vec<DepthExpr<'a>>>>, @@ -25,8 +25,6 @@ pub fn parse<'a>(vec: &Vec<Expr<'a>>) -> Vec<DepthExpr<'a>> { while let Some(e) = it.next() { match e.expr { ExprT::Decision((cond, scope)) => { - let cond = DepthExpr::Process(cond); - let then_branch = parse(&entire_scopes(&mut it)); let else_branch = if let Some(n) = it.peek() { |
