mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 04:13:46 +00:00
Estimated hours taken: 2
Branches: main
Fix a problem with the representation of goal paths for switches on unbounded
numbers of function symbols, such as ints, floats and strings. We used to
represent such switches as a negative number in the field representing the
number of function symbols in the switched-on type, but some parts of the
system weren't handling negative numbers specially, and they couldn't be
properly parsed back in anyway (since "-" was also the character separating
the case's ordinal number from this number).
mdbcomp/program_representation.m:
Change the switch goal path step to use a maybe type to record the
number of function symbols in the switched-on type, with a "no" meaning
the type is unbounded. Update the goal path step printing and parsing
code accordingly.
Make the names of some other function symbols more expressive.
browser/declarative_execution.m:
Conform to the change to program_representation.m.
compiler/goal_path.m:
compiler/deep_profiling.m:
compiler/unneeded_code.m:
Update the code that creates goal path steps.
In deep_profiling.m, fix an old bug: the two integers (case number,
number of function symbols in switched-on type) were swapped.
In deep_profiling.m, give a prefix to the field names of the main
structure passed around, to try to make them unique.
tests/debugger/switch_on_unbounded.{m,inp,exp}:
New test case to test this fix.
tests/debugger/Mmakefile:
Enable the new test case.
16 lines
138 B
Plaintext
16 lines
138 B
Plaintext
echo on
|
|
register --quiet
|
|
break edge
|
|
continue
|
|
print *
|
|
step
|
|
print *
|
|
delete *
|
|
break edge_str
|
|
continue
|
|
print *
|
|
step
|
|
print *
|
|
delete *
|
|
continue
|