mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
compiler/prog_item.m:
Allow the representation of a clause whose body couldn't be parsed
due to one or more syntax errors.
compiler/hlds_clauses.m:
Change the clauses_info type to allow us to record that one or more
clauses were not added to it because their bodies had syntax errors.
compiler/prog_io_item.m:
compiler/prog_io_dcg.m:
Parse the head of a clause even if the body has errors. If we can
parse the clause head, and can thus identify the predicate or function
it is for, then record the clause, even if we can't parse the body goal.
(If both the head and body have syntax errors, previously we found
and printed only the errors from the body; we now find and print both.)
Harmonize the treatment of varsets casts in the predicates that parse
DCG and non-DCG clauses.
compiler/prog_io_goal.m:
Include the word "Error" in error messages that didn't have them.
compiler/add_clause.m:
When we add a clause to the clauses_info, if that clause has a
syntax error in the body, then record that fact.
If there are several things wrong with a clause, print error messages
for all of them, not just the first one we find.
Reorder the arguments of a predicate to put all the state vars last.
compiler/typecheck.m:
If a predicate has no valid clauses, but its clauses_info records that
it did have clauses with syntax errors, then do not generate an error
message saying "Error: no clauses for predicate p/n", since that would
be incorrect and therefore misleading. However, DO record the presence
of the error INDEPENDENT of the error message, so that we don't try
to continue processing a procedure body that isn't actually there.
compiler/add_class.m:
compiler/add_foreign_proc.m:
compiler/add_mutable_aux_preds.m:
compiler/add_pragma_tabling.m:
compiler/add_pragma_type_spec.m:
compiler/add_pred.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/get_dependencies.m:
compiler/higher_order.m:
compiler/hlds_out_pred.m:
compiler/hlds_pred.m:
compiler/make_hlds_passes.m:
compiler/parse_tree_out_clause.m:
compiler/polymorphism.m:
compiler/prog_item_stats.m:
compiler/unify_proc.m:
Conform to the changes above.
compiler/prog_io_sym_name.m:
Fix an unrelated problem I came across.
tests/invalid/malformed_ite.err_exp:
tests/invalid/record_syntax_errors.err_exp:
tests/invalid/some.err_exp:
tests/invalid/trace_goal_env.err_exp:
Don't expect misleading "Error: no clauses for predicate p/n" messages.
tests/invalid/try_bad_params.err_exp:
Don't expect misleading "Error: no clauses for predicate p/n" messages.
Do expect other error messages with their updated wording.
12 lines
641 B
Plaintext
12 lines
641 B
Plaintext
malformed_ite.m:027: Error: malformed if-then-else; this `then' is missing its
|
|
malformed_ite.m:027: `if'.
|
|
malformed_ite.m:035: Error: malformed if-then-else; replace the `->' with
|
|
malformed_ite.m:035: `then'.
|
|
malformed_ite.m:045: Error: malformed if-then-else; replace the `;' with
|
|
malformed_ite.m:045: `else'.
|
|
malformed_ite.m:051: Error: malformed if-then-else; replace the `->' with
|
|
malformed_ite.m:051: `then', and add an `if' before the condition.
|
|
malformed_ite.m:061: Error: malformed if-then-else; replace the `;' with
|
|
malformed_ite.m:061: `else'.
|
|
malformed_ite.m:067: Error: malformed if-then-else; this `if' has no `then'.
|