it's unclear currently why some objects have .optimize() method while some do not. Examples of some that do include: Ast.Input and Ast.BooleanExpression, while those that don't include Ast.Expression and Ast.Statement. However, it seems if an object does not have such a method, you can find a function in optimize.ts that provides the functionality. This inconsistency can be confusing to developers.
If it makes sense to add an .optimize() method for all nodes, I believe we should go ahead and do it.
it's unclear currently why some objects have
.optimize()method while some do not. Examples of some that do include:Ast.InputandAst.BooleanExpression, while those that don't includeAst.ExpressionandAst.Statement. However, it seems if an object does not have such a method, you can find a function inoptimize.tsthat provides the functionality. This inconsistency can be confusing to developers.If it makes sense to add an
.optimize()method for all nodes, I believe we should go ahead and do it.