dewolf icon indicating copy to clipboard operation
dewolf copied to clipboard

Simplify branches with true or false conditions

Open steffenenders opened this issue 2 years ago • 3 comments

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

steffenenders avatar Jul 29 '22 09:07 steffenenders

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.

fnhartmann avatar Jan 17 '24 09:01 fnhartmann

/cib

fnhartmann avatar Jan 17 '24 09:01 fnhartmann