summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-10-05 22:07:38 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-10-05 22:07:38 +0800
commitdac1ae7fbc73d44274fe77e4c74cdac9bb0d440e (patch)
treebf6709a067525e9999a13e20d3739b329ae257d4 /src
parentf6e4972fd1b62d962d514ba9641ae19fcc5549d9 (diff)
ast: more sensible Decision::cond data type
Diffstat (limited to 'src')
-rw-r--r--src/ast.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ast.rs b/src/ast.rs
index a23c688..fb648e0 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -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() {