mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
This fixes the second problem identified by Mantis bug #548. compiler/ml_tag_switch.m: Detect the circumstances in which this problem would arise. In such cases, simply fail, and let ml_switch_gen.m fall back to implementing the switch as an if-then-else chain. compiler/ml_switch_gen.m: Implement that fallback. compiler/switch_util.m: The new code in ml_tag_switch.m needs to thread a fourth piece of state through the predicate it passes to group_cases_by_ptag, so change its argument list to accommodate such predicates. And since some other modules pass the same predicates to group_cases_by_ptag and string_binary_cases, make the same change in the argument list of that predicate as well. Delete one stray comment, and note that another comment seems misplaced. compiler/ml_string_switch.m: compiler/string_switch.m: compiler/switch_case.m: compiler/tag_switch.m: Conform to the changes in switch_util.m. tests/hard_coded/bug548.exp: tests/hard_coded/Mmakefile: Enable the previously-added test case for Mantis #548, after add an .exp file for it.
2 lines
3 B
Plaintext
2 lines
3 B
Plaintext
42
|