Closed pjljvandelaar closed 1 year ago
Alternatively, first use prefer short circuit patch and then use prefer membership test
Won't add the patterns, since a clear and nice path already exists (prefer short circuit + prefer membership tests). Of course, users can add this pattern if they consider it important to do in a single step.
Our membership rewriter current is: https://github.com/TNO/Rewriters-Ada/blob/47ca5f092d736ce7ab86a0214008023dd59b2f4f/src/predefined_rewriters_membership_test.ads#L46-L51
It checks for "or else" expressions.
Also add a pattern to check for "or" expressions. Of course, also assert no side effects in
$S_Val2
since it might no longer be executed!