Open pieterhijma opened 1 month ago
I initially wanted to create a separate PR for this problem with an expression rewriter, but since rewriters typically require private access to expressions, it is necessary to add methods to expressions, making it hard to separate the rewriter from the context in which it is used. I will therefore include the code for the rewriter in #12532.
This commit in PR #12532 adds an expression rewriter, solving this issue.
Is there an existing issue for this?
Problem description
The expression visitor (
App/Expression.h
,App/ExpressionVisitors.h
) are incapable of rewriting expression tree. ClassExpressionVisitor
allows walking expression trees and gather information, for example gathering all object identifiers. SubclassExpressionModifier
is able to modify individual nodes in the expression tree, for example modify a specific object identifier. However, it is not possible to (easily) rewrite the expression tree such as adding expression nodes or removing ones.Full version info
Subproject(s) affected?
Core
Anything else?
For context, rewriting expression trees is required for #12532 to add hiddenrefs automatically at selected places.
Code of Conduct