mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
Add two new format components to the error_util library: decl/1 and
pragma_decl/1. These are converted into strings as follows:
decl(<Decl>) ==> `:- <Decl>'
pragma_decl(<Decl>) ==> `:- pragma <Decl>'
The motivation for this change is that error messages about declarations
often contain text similar to:
... in `:- foo' declaration ...
At least that is what occurs most of the time; in some cases the `:-' part is
omitted, in other cases the quotes are omitted. Using the new format
components makes these consistency problems less likely to occur. The error
specs are also more concise as well.
This commit also addresses a number of other minor issues related to error.
compiler/error_util.m:
Add the two new format components describe above.
Use add_quotes/1 as a single point of control for how single quotes
are added where possible in this module.
Call unexpected/3 in preference to error/1.
compiler/goal_expr_to_goal.m;
Quote the word 'else' when referring the 'else' part of a try goal
in an error message.
compiler/hlds_out_util.m:
Add an XXX comment about cons_ids being incorrectly quoted in
error messages.
compiler/det_report.m:
Pass the message description to report_determinism_problem/7 as a list
of format_components rather than as a string.
compiler/make_hlds_warn.m:
Capitalize the word "Warning" when it occurs at the beginning of a warning.
compiler/typecheck_errors.m:
compiler/modules.m:
Fix problems I noticed during my previous change.
compiler/add_pragma.m:
compiler/add_type.m:
compiler/det_analysis.m:
compiler/make_hlds_passes.m:
compiler/modules.m:
compiler/oisu_check.m:
compiler/prog_io.m:
compiler/prog_io_mode_defn.m:
compiler/prog_io_mutable.m:
compiler/prog_io_pragma.m:
compiler/prog_io_sym_name.m:
compiler/term_constr_errors.m:
compiler/term_errors.m
compiler/termination.m:
compiler/typecheck_errors.m:
Conform to the above changes.
tests/invalid/bad_finalise_decl.err_exp:
tests/invalid/bad_initialise_decl.err_exp:
tests/invalid/bad_mutable.err_exp:
tests/invalid/bug83.err_exp:
tests/invalid/ee_invalid.err_exp:
tests/invalid/foreign_enum_import.err_exp:
tests/invalid/foreign_enum_invalid.err_exp:
tests/invalid/foreign_type_missing.err_exp:
tests/invalid/hawkins_mm_fail_reset.err_exp:
tests/invalid/loopcheck.err_exp:
tests/invalid/nested_impl_in_int.err_exp:
tests/invalid/oisu_check_add_pragma_errors.err_exp:
tests/invalid/oisu_check_semantic_errors.err_exp:
tests/invalid/reserve_tag.err_exp:
tests/invalid/try_io_else.err_exp:
tests/warnings/foreign_term_invalid.exp:
tests/warnings/warn_return.exp*:
tests/warnings/warn_succ_ind.exp*:
Update expected (error) outputs to conform to the above.
3 lines
131 B
Plaintext
3 lines
131 B
Plaintext
warn_return.m:028: Warning: the Java code for predicate `warn_return.foo'/2 may
|
|
warn_return.m:028: contain a `return' statement.
|