Module optimizer

Module optimizer 

Source
Expand description

Transformation routines to optimize an Expression AST.

Functionsยง

fold_constants
Evaluates Expression::Unary, Expression::Binary Expression::Array into a single Expression::Literal if all arguments are also an Expression::Literal.
optimize
Transforms an Expression tree by applying transform_ternary and fold_constants in a loop until no further optimization is possible.
transform_ternary
Recursivly transforms ternary function calls into Expression::Ternary. Three parameter crate::stdlib::common::if_then calls are transformed into a Operator::TernaryCondition;