mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
... effectively replacing part of the functionality of the existing
--warn-singleton-vars option.
compiler/options.m:
doc/user_guide.texi:
Add and document the new option.
compiler/prog_data.m:
doc/reference_manual.texi:
Add and document a new warning name that allows the new option
to be turned off inside a disable_warning scope.
NEWS.md:
Announce the two changes above.
compiler/parse_goal.m:
compiler/parse_tree_out_misc.m:
Parse and unparse the new kind warning in disable_warning scopes.
compiler/make_hlds_warn.m:
We used to avoid traversing the subgoal of a disable_warning scope
if that scope turned off singleton variable warnings. Document why
this is a BUG, and start traversing the scope's subgoal in such cases.
Switch from always constructing error_specs containing conditions
to conditionally constructing error_specs that contain no conditions.
This is required by the change above, because the condition in
conditional error_specs would later be evaluated based on the value
of the specified option in the globals structure, which means that
that test would *ignore* disable_warning scopes. The conditions
under which now construct those error_specs *do* respect those scopes.
Put the enabled/disabled state of each warning into a separate params
structure that, unlike the warn_info structure, contains information
that only ever flows downward, and is never modified except at
disable_warning scopes. Move into this new structure the fields
of the old warn_info structure that share this property.
compiler/add_clause.m:
compiler/simplify_goal_scope.m:
Conform to the changes above.
tests/warnings/repeated_singleton.{m,err_exp}:
A new test case that tests the new option, and the mechanism
for disabling it in a scope.
tests/warnings/Mmakefile:
Enable the new test case.
648 B
648 B
repeated_singleton.m:030: In clause for predicate `test_a'/4:
repeated_singleton.m:030: warning: variable `_AT' occurs more than once in
repeated_singleton.m:030: this scope.
repeated_singleton.m:032: In clause for predicate `test_a'/4:
repeated_singleton.m:032: warning: variable `_AT' occurs more than once in
repeated_singleton.m:032: this scope.
repeated_singleton.m:047: In clause for predicate `test_b'/4:
repeated_singleton.m:047: warning: variable `_AT' occurs more than once in
repeated_singleton.m:047: this scope.
repeated_singleton.m:030: warning: variable `_AT' occurs more than once in
repeated_singleton.m:030: this scope.
repeated_singleton.m:032: In clause for predicate `test_a'/4:
repeated_singleton.m:032: warning: variable `_AT' occurs more than once in
repeated_singleton.m:032: this scope.
repeated_singleton.m:047: In clause for predicate `test_b'/4:
repeated_singleton.m:047: warning: variable `_AT' occurs more than once in
repeated_singleton.m:047: this scope.