dewolf
dewolf copied to clipboard
Simplify branches with true or false conditions
Proposal
This is a follow-up issue from #59 .
if a condition is false, then we can simply remove the true branch and execute always the false branch, i.e., we can substitute the condition node with the false branch. Symmetrically, one would replace each condition node with condition true by its true branch. But, in cases like this where the condition should not be false, we may lose content we do not want to lose.
Approach
No response
Discussed to be implemented inside the CodeGenerator and not directly on the AST in earlier stages. There will be a config option since we are "deleting" code with this.
/cib
Branch issue-102-Simplify_branches_with_true_or_false_conditions created!