pub fn explicit_exponents(self) -> Expression {
        match self {
            Expression::Variadic(Operator::Mul, exprs) => {
                let exprs = exprs
                    .into_iter()
                    .map(Expression::explicit_exponents)
                    .map(|expr| match expr {
                        expr @ Expression::Binary(Operator::Exp, _, _) => expr,

                        other => Expression::Binary(
                            Operator::Exp,
                            Box::new(other),
                            Box::new(Expression::integer_expression(1)),
                        ),
                    })
                    .collect();
                Expression::Variadic(Operator::Mul, exprs)
            }
            other => other.apply_on_others(Expression::explicit_exponents),
        }
    }
//Makes all expressions under multiplication node exponentials. Makes it easier to group them.
Makes all expressions under multiplication node exponentials. Makes it easier to group them.
Makes all expressions under multiplication node exponentials . Makes it easier to group them .
pub fn explicit_exponents(self) -> Expression {
        match self {
            Expression::Variadic(Operator::Mul, exprs) => {
                let exprs = exprs
                    .into_iter()
                    .map(Expression::explicit_exponents)
                    .map(|expr| match expr {
                        expr @ Expression::Binary(Operator::Exp, _, _) => expr,
                        other => Expression::Binary(
                            Operator::Exp,
                            Box::new(other),
                            Box::new(Expression::integer_expression(1)),
                        ),
                    })
                    .collect();
                Expression::Variadic(Operator::Mul, exprs)
            }
            other => other.apply_on_others(Expression::explicit_exponents),
        }
    }
pub fn explicit_exponents ( self ) -> Expression { match self { Expression :: Variadic ( Operator :: Mul , exprs ) => { let exprs = exprs . into_iter ( ) . map ( Expression :: explicit_exponents ) . map ( | expr | match expr { expr @ Expression :: Binary ( Operator :: Exp , _ , _ ) => expr , other => Expression :: Binary ( Operator :: Exp , Box :: new ( other ) , Box :: new ( Expression :: integer_expression ( 1 ) ) , ) , } ) . collect ( ) ; Expression :: Variadic ( Operator :: Mul , exprs ) } other => other . apply_on_others ( Expression :: explicit_exponents ) , } }
Makes all expressions under multiplication node exponentials.
Makes all expressions under multiplication node exponentials .
self
self