gh-108113: Make it possible to create an optimized AST (#108154)

10 files changed