From 5697ecb492579413a7ce9589df6847a3e205c647 Mon Sep 17 00:00:00 2001 From: Jonas Maier Date: Fri, 8 May 2026 16:15:20 +0200 Subject: if parse test --- src/parse/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/parse/mod.rs') diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 8cc6a4f..47aff20 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -124,6 +124,22 @@ pub fn pipes(cmds: [Command; N]) -> Ast, + true_block: Block, + false_block: Block, +) -> Ast { + let Ast::Pipes(condition) = condition else { + panic!() + }; + Ast::If(If { + condition, + true_block, + false_block, + parse_progress: IfParseProgress::Done, + }) +} + pub fn estr(x: &[u8]) -> ExpString { ExpString { parts: vec![StringPart::Boring(x.to_vec())], -- cgit v1.2.3