Expand description
Transformation routines to optimize an Expression AST.
Functionsยง
- fold_
constants - Evaluates
Expression::Unary,Expression::BinaryExpression::Arrayinto a singleExpression::Literalif all arguments are also anExpression::Literal. - optimize
- Transforms an
Expressiontree by applyingtransform_ternaryandfold_constantsin a loop until no further optimization is possible. - transform_
ternary - Recursivly transforms ternary function calls into
Expression::Ternary. Three parametercrate::stdlib::common::if_thencalls are transformed into aOperator::TernaryCondition;