Skip to main content

Module optimizing

Module optimizing 

Source
Expand description

Optimization for format descriptions.

The tree of all items is walked recursively and optimized in-place. Optimizations are ordered so that their effects are consumed by later optimizations in a single pass. Children are optimized before their parent, so sibling-level interactions are the only concern at each level.

Each optimization function accepts self mutably and returns whether it modified the tree. Note that optimizations must not affect runtime behavior in terms of formatting output, accepted input when parsing, or output from the parser.