From 9d99b509b251afa7480c4669e93e4f2a279c834b Mon Sep 17 00:00:00 2001 From: rvcas Date: Thu, 7 Mar 2024 13:58:25 -0500 Subject: [PATCH] chore: this should be gone --- crates/aiken-lang/src/ast.rs | 50 ------------------------------------ 1 file changed, 50 deletions(-) diff --git a/crates/aiken-lang/src/ast.rs b/crates/aiken-lang/src/ast.rs index 9c61b85c..c05b55d1 100644 --- a/crates/aiken-lang/src/ast.rs +++ b/crates/aiken-lang/src/ast.rs @@ -273,56 +273,6 @@ impl From for TypedFunction { } } -impl TypedTest { - pub fn test_hint(&self) -> Option<(BinOp, Box, Box)> { - if self.arguments.is_empty() { - do_test_hint(&self.body) - } else { - None - } - } -} - -pub fn do_test_hint(body: &TypedExpr) -> Option<(BinOp, Box, Box)> { - match body { - TypedExpr::BinOp { - name, - tipo, - left, - right, - .. - } if tipo == &bool() => Some((*name, left.clone(), right.clone())), - TypedExpr::Sequence { expressions, .. } | TypedExpr::Pipeline { expressions, .. } => { - if let Some((binop, left, right)) = do_test_hint(&expressions[expressions.len() - 1]) { - let mut new_left_expressions = expressions.clone(); - new_left_expressions.pop(); - new_left_expressions.push(*left); - - let mut new_right_expressions = expressions.clone(); - new_right_expressions.pop(); - new_right_expressions.push(*right); - - Some(( - binop, - TypedExpr::Sequence { - expressions: new_left_expressions, - location: Span::empty(), - } - .into(), - TypedExpr::Sequence { - expressions: new_right_expressions, - location: Span::empty(), - } - .into(), - )) - } else { - None - } - } - _ => None, - } -} - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct TypeAlias { pub alias: String,