tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the tests
that check compiler error messages, expect the new line numbers.
browser/cterm.m:
browser/tree234_cc.m:
Import only one module per line.
tests/hard_coded/boyer.m:
Fix something I missed.
Estimated hours taken: 4
Branches: main
Improve the compiler's ability to deal with determinism errors, in three ways.
1. Add a new pragma, no_determinism_warning, that suppresses the compiler's
warning about a determinism declaration that is not as tight as possible.
2. When printing determinism errors about disjunctions in supposed-to-be-det
code, print the list of switch arms that the disjunction is in. Without
this, it can be hard to find duplicated cases in a long list of switch
cases. (If the report tells you there is a disjunction in the arm for
f/1 in the switch on X, it tells you that you have duplicated the arm
for X = f(_).)
3. When the compiler prints a message about a switch on a variable not covering
some cases, sometimes the variable is an anonymous variable:
The switch on V_16 does not cover ...
These anonymous variables are created by common-structure elimination,
which groups disjuncts containing unifications such as A = f(a), A = f(b),
A = f(c) into a single arm of the switch on A, A = f(V_16), with a switch
inside that on V_16.
The third part of this diff gives the context of the error in the error
switch as not being the arm for f/1 in the switch on A, but as the arm for
f(V_16) in the switch on A, thus letting users know where the anonymous
variable comes from.
doc/reference_manual.texi:
Document the new pragma.
compiler/prog_item.m:
Add the new pragma to the list of pragmas we recognize.
compiler/hlds_pred.m:
Add the new kind of predicate marker whose presence indicates
that this pragma was given for this predicate.
compiler/prog_io_pragma.m:
Parse the new pragma.
compiler/add_pragma.m:
Process the new pragma: when found, set the marker on the named
predicate.
compiler/det_report.m:
Make all three changes listed above.
In addition, fix a problem that used to happen only rarely:
when printing switch contexts, we used to print them from the inside
out, not the outside in.
Capitalize only the first clause in a multi-clause error message.
compiler/hlds_out_util.m:
Add a function for printing a cons_id either with or without its
arguments, for use by det_report.m Let this function string module
qualifiers from cons_ids, since these are virtually always obvious,
and whose printing is therefore unnecessary clutter.
compiler/equiv_type.m:
compiler/hlds_out_pred.m:
compiler/make_hlds_passes.m:
compiler/mercury_to_mercury.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/recompilation.version.m:
compiler/table_gen.m:
Conform to the changes above.
tests/invalid/det_errors.{m,err_exp}:
Add some predicates to this module to test the new functionality,
and update the expected output.
Estimated hours taken: 0.5
Branches: main
compiler/det_report.m:
Fix a problem with the formatting of some error messages.
tests/invalid/det_errors.{m,exp}:
Add to this test case a test for the new fix.