[m-rev.] diff: further consistency improvments for error and warning messages.

Julien Fischer jfischer at opturion.com
Wed Jul 30 23:07:07 AEST 2014


Branches: master

Further consistency improvements for error and warning messages.

The two main changes in this commit are:

(1) Use the error_util library's decl/1 and pramga_decl/1 format components in more
places.

(2) Quote type variables that appear in error messages.

compiler/error_util.m:
 	Add a version of list_to_pieces/1 that places each of the strings in
 	the input list in single quotes.

compiler/prog_io_type_defn.m:
 	Quote type variables names in error messages.

compiler/add_class.m:
compiler/add_pragma.m:
compiler/add_pred.m:
compiler/check_typeclass.m:
compiler/make_hlds_error.m:
compiler/post_typecheck.m:
compiler/prog_io.m:
 	Use the error_util library's decl/1 and pragma_decl/1 format components
 	in more places.

compiler/mode_errors.m:
 	Quote program variables and insts in some error messages.

compiler/post_term_analysis.m:
 	Format a type ctor and arity in an error message properly.

tests/invalid/*.err_exp:
tests/warnings/*.exp:
 	Conform to the above changes.

diff --git a/compiler/add_class.m b/compiler/add_class.m
index a0a14df..eea02d2 100644
--- a/compiler/add_class.m
+++ b/compiler/add_class.m
@@ -709,7 +709,8 @@ pred_method_with_no_modes_error(PredInfo, !Specs) :-
  undefined_type_class_error(ClassName, Arity, Context, Description, !Specs) :-
      Pieces = [words("Error:"), words(Description), words("for"),
          sym_name_and_arity(ClassName / Arity),
-        words("without preceding typeclass declaration."), nl],
+        words("without preceding"), decl("typeclass"), words("declaration."),
+        nl],
      Msg = simple_msg(Context, [always(Pieces)]),
      Spec = error_spec(severity_error, phase_parse_tree_to_hlds, [Msg]),
      !:Specs = [Spec | !.Specs].
diff --git a/compiler/add_pragma.m b/compiler/add_pragma.m
index c840bff..754be50 100644
--- a/compiler/add_pragma.m
+++ b/compiler/add_pragma.m
@@ -2639,7 +2639,7 @@ set_eval_method_create_aux_preds(ProcId, ProcInfo0, Context, SimpleCallId,
                  MaybeError = yes(ArgMsg - ErrorMsg),
                  EvalMethodStr = eval_method_to_string(EvalMethod),
                  Pieces = [words("Error in"),
-                    quote("pragma " ++ EvalMethodStr),
+                    pragma_decl(EvalMethodStr),
                      words("declaration for"), simple_call(SimpleCallId),
                      suffix(":"), nl, fixed(ArgMsg), words(ErrorMsg), nl],
                  Msg = simple_msg(Context, [always(Pieces)]),
diff --git a/compiler/add_pred.m b/compiler/add_pred.m
index b5bb932..e955742 100644
--- a/compiler/add_pred.m
+++ b/compiler/add_pred.m
@@ -418,7 +418,8 @@ module_add_mode(InstVarSet, PredName, Modes, MaybeDet, Status, MContext,
      ;
          preds_add_implicit_report_error(!ModuleInfo, ModuleName,
              PredName, Arity, PredOrFunc, Status, IsClassMethod, MContext,
-            origin_user(PredName), [words("mode declaration")], PredId, !Specs)
+            origin_user(PredName), [decl("mode"), words("declaration")],
+            PredId, !Specs)
      ),
      module_info_get_predicate_table(!.ModuleInfo, PredicateTable1),
      predicate_table_get_preds(PredicateTable1, Preds0),
diff --git a/compiler/check_typeclass.m b/compiler/check_typeclass.m
index c7d8c25..e81b945 100644
--- a/compiler/check_typeclass.m
+++ b/compiler/check_typeclass.m
@@ -1634,7 +1634,7 @@ report_coverage_error(ClassId, InstanceDefn, Vars) = Spec :-
          sym_name_and_arity(SymName / Arity), suffix(":"), nl,
          words("functional dependency not satisfied:"),
          words(choose_number(Vars, "type variable", "type variables"))]
-        ++ list_to_pieces(VarsStrs) ++
+        ++ list_to_quoted_pieces(VarsStrs) ++
          [words(choose_number(Vars, "occurs", "occur")),
          words("in the range of the functional dependency, but"),
          words(choose_number(Vars, "is", "are")),
@@ -1823,7 +1823,7 @@ report_unbound_tvars_in_pred_context(Vars, PredInfo) = Spec :-
          suffix(":"), nl,
          words("error in type class constraints:"),
          words(choose_number(Vars, "type variable", "type variables"))]
-        ++ list_to_pieces(VarsStrs) ++
+        ++ list_to_quoted_pieces(VarsStrs) ++
          [words(choose_number(Vars, "occurs", "occur")),
          words("in the constraints, but"),
          words(choose_number(Vars, "is", "are")),
@@ -1853,7 +1853,7 @@ report_unbound_tvars_in_ctor_context(Vars, TypeCtor, TypeDefn) = Spec :-
          sym_name_and_arity(SymName / Arity), suffix(":"), nl,
          words("error in type class constraints:"),
          words(choose_number(Vars, "type variable", "type variables"))]
-        ++ list_to_pieces(VarsStrs) ++
+        ++ list_to_quoted_pieces(VarsStrs) ++
          [words(choose_number(Vars, "occurs", "occur")),
          words("in the constraints, but"),
          words(choose_number(Vars, "is", "are")),
@@ -1950,7 +1950,7 @@ report_badly_quantified_vars(PredInfo, QuantErrorType, TVars) = Spec :-
      TypeVariables = [words("type variable"),
          suffix(choose_number(TVars, "", "s"))],
      TVarsStrs = list.map(mercury_var_to_string(TVarSet, no), TVars),
-    TVarsPart = list_to_pieces(TVarsStrs),
+    TVarsPart = list_to_quoted_pieces(TVarsStrs),
      Are = words(choose_number(TVars, "is", "are")),
      (
          QuantErrorType = universal_constraint,
diff --git a/compiler/error_util.m b/compiler/error_util.m
index 9b33e51..6ecd097 100644
--- a/compiler/error_util.m
+++ b/compiler/error_util.m
@@ -355,6 +355,10 @@
      %
  :- func list_to_pieces(list(string)) = list(format_component).

+    % As above, but surround each string by `' quotes.
+    %
+:- func list_to_quoted_pieces(list(string)) = list(format_component).
+
      % Convert a list of lists of format_components into a list of
      % format_components separated by commas, with the last two elements
      % separated by `and'.
@@ -894,6 +898,12 @@ list_to_pieces([Elem1, Elem2]) = [fixed(Elem1), words("and"), fixed(Elem2)].
  list_to_pieces([Elem1, Elem2, Elem3 | Elems]) =
      [fixed(Elem1 ++ ",") | list_to_pieces([Elem2, Elem3 | Elems])].

+list_to_quoted_pieces([]) = [].
+list_to_quoted_pieces([Elem]) = [quote(Elem)].
+list_to_quoted_pieces([Elem1, Elem2]) = [quote(Elem1), words("and"), quote(Elem2)].
+list_to_quoted_pieces([Elem1, Elem2, Elem3 | Elems]) =
+    [quote(Elem1), suffix(",") | list_to_quoted_pieces([Elem2, Elem3 | Elems])].
+
  component_lists_to_pieces([]) = [].
  component_lists_to_pieces([Comps]) = Comps.
  component_lists_to_pieces([Comps1, Comps2]) =
diff --git a/compiler/make_hlds_error.m b/compiler/make_hlds_error.m
index a5baca0..b3a5adc 100644
--- a/compiler/make_hlds_error.m
+++ b/compiler/make_hlds_error.m
@@ -110,8 +110,8 @@ undefined_pred_or_func_error(Name, Arity, Context, DescPieces, !Specs) :-
      % Which is more correct?
      Pieces = [words("Error:") | DescPieces] ++ [words("for"),
          sym_name_and_arity(Name / Arity),
-        words("without corresponding"), quote("pred"), words("or"),
-        quote("func"), words("declaration.")],
+        words("without corresponding"), decl("pred"), words("or"),
+        decl("func"), words("declaration.")],
      Msg = simple_msg(Context, [always(Pieces)]),
      Spec = error_spec(severity_error, phase_parse_tree_to_hlds, [Msg]),
      !:Specs = [Spec | !.Specs].
@@ -193,7 +193,7 @@ maybe_undefined_pred_error(Globals, Name, Arity, PredOrFunc, Status,
      ;
          Pieces = [words("Error:") | DescPieces] ++ [words("for"),
              simple_call(simple_call_id(PredOrFunc, Name, Arity)), nl,
-            words("without preceding"), quote(pred_or_func_to_str(PredOrFunc)),
+            words("without preceding"), decl(pred_or_func_to_str(PredOrFunc)),
              words("declaration."), nl],
          Msg = simple_msg(Context, [always(Pieces)]),
          Spec = error_spec(severity_error, phase_parse_tree_to_hlds, [Msg]),
diff --git a/compiler/mode_errors.m b/compiler/mode_errors.m
index a9b2f44..a7e3bee 100644
--- a/compiler/mode_errors.m
+++ b/compiler/mode_errors.m
@@ -1218,8 +1218,9 @@ purity_error_should_be_in_promise_purity_scope_to_spec(NegCtxtDesc,
              words("purity error: if-then-else"),
              words("should be inside a promise_purity"),
              words("scope because non-local variable"),
-            words(mercury_var_to_string(VarSet, no, Var)),
-            words("has inst any and appears in the condition.")
+            quote(mercury_var_to_string(VarSet, no, Var)),
+            words("has inst"), quote("any"),
+            words("and appears in the condition.")
          ]
      ;
          NegCtxtDesc = negation,
@@ -1227,8 +1228,9 @@ purity_error_should_be_in_promise_purity_scope_to_spec(NegCtxtDesc,
              words("purity error: negation"),
              words("should be inside a promise_purity"),
              words("scope because non-local variable"),
-            words(mercury_var_to_string(VarSet, no, Var)),
-            words("has inst any and appears in the body.")
+            quote(mercury_var_to_string(VarSet, no, Var)),
+            words("has inst"), quote("any"),
+            words("and appears in the body.")
          ]
      ),
      Spec = error_spec(severity_error, phase_mode_check(report_in_any_mode),
diff --git a/compiler/post_term_analysis.m b/compiler/post_term_analysis.m
index 3e53622..f42a351 100644
--- a/compiler/post_term_analysis.m
+++ b/compiler/post_term_analysis.m
@@ -34,6 +34,7 @@

  :- import_module backend_libs.
  :- import_module backend_libs.foreign.
+:- import_module check_hlds.type_util.
  :- import_module hlds.goal_form.
  :- import_module hlds.goal_util.
  :- import_module hlds.hlds_data.
@@ -225,7 +226,7 @@ get_user_unify_compare(_ModuleInfo, TypeBody, UnifyCompare) :-

  emit_non_term_user_special_warning(Globals, Context, SpecialPred, TypeCtor,
          !IO) :-
-    TypeCtorString = type_ctor_to_string(TypeCtor),
+    type_ctor_module_name_arity(TypeCtor, TypeModule, TypeName, TypeArity),
      (
          SpecialPred = spec_pred_unify,
          SpecialPredStr = "equality"
@@ -241,7 +242,8 @@ emit_non_term_user_special_warning(Globals, Context, SpecialPred, TypeCtor,
      ),
      Pieces = [words("Warning: the user-defined "),
          fixed(SpecialPredStr ++ " predicate"),
-        words("for the type "), fixed(TypeCtorString),
+        words("for the type "),
+        sym_name_and_arity(qualified(TypeModule, TypeName) / TypeArity),
          words("cannot be proven to terminate.")],
      report_warning(Globals, Context, 0, Pieces, !IO).

diff --git a/compiler/post_typecheck.m b/compiler/post_typecheck.m
index 0579480..2c44752 100644
--- a/compiler/post_typecheck.m
+++ b/compiler/post_typecheck.m
@@ -925,7 +925,7 @@ report_unbound_inst_var_error(ModuleInfo, PredId, ProcId, Procs0, Procs,
          !Specs) :-
      map.lookup(Procs0, ProcId, ProcInfo),
      proc_info_get_context(ProcInfo, Context),
-    Pieces = [words("In mode declaration for")] ++
+    Pieces = [words("In"), decl("mode"), words("declaration for")] ++
          describe_one_pred_name(ModuleInfo, should_not_module_qualify, PredId)
          ++ [suffix(":"), nl,
          words("error: unbound inst variable(s)."), nl,
diff --git a/compiler/prog_io.m b/compiler/prog_io.m
index d945451..499a8f9 100644
--- a/compiler/prog_io.m
+++ b/compiler/prog_io.m
@@ -1832,8 +1832,8 @@ parse_pred_mode_decl(Functor, ArgTerms, ModuleName, PredModeTerm, VarSet,
          )
      ;
          PredModeTermStr = describe_error_term(VarSet, PredModeTerm),
-        Pieces = [words("Error: syntax error in mode declaration at"),
-            words(PredModeTermStr), suffix("."), nl],
+        Pieces = [words("Error: syntax error in"), decl("mode"),
+            words("declaration at"), words(PredModeTermStr), suffix("."), nl],
          Spec = error_spec(severity_error, phase_term_to_parse_tree,
              [simple_msg(get_term_context(PredModeTerm), [always(Pieces)])]),
          MaybeItem = error1([Spec])
diff --git a/compiler/prog_io_type_defn.m b/compiler/prog_io_type_defn.m
index 4164f4c..4df67cc 100644
--- a/compiler/prog_io_type_defn.m
+++ b/compiler/prog_io_type_defn.m
@@ -406,13 +406,13 @@ process_du_ctors(Params, VarSet, BodyTerm, [Ctor | Ctors], !Specs) :-
          % There should be no duplicate names to remove.
          set.to_sorted_list(ExistQParamsSet, ExistQParams),
          varset.coerce(VarSet, GenericVarSet),
-        ExistQParamVarsStr =
-            mercury_vars_to_string(GenericVarSet, no, ExistQParams),
+        ExistQParamVarsStrs = list.map(mercury_var_to_string(GenericVarSet, no),
+            ExistQParams),
          Pieces = [words("Error:"),
              words(choose_number(ExistQParams,
-                "type variable", "type variables")),
-            words(ExistQParamVarsStr),
-            words(choose_number(ExistQParams, "has", "have")),
+                "type variable", "type variables"))] ++
+            list_to_quoted_pieces(ExistQParamVarsStrs) ++
+            [words(choose_number(ExistQParams, "has", "have")),
              words("overlapping scopes"),
              words("(explicit type quantifier shadows argument type)."), nl],
          Spec = error_spec(severity_error, phase_term_to_parse_tree,
diff --git a/tests/invalid/ambiguous_method.err_exp b/tests/invalid/ambiguous_method.err_exp
index 2abb7c2..d34a29b 100644
--- a/tests/invalid/ambiguous_method.err_exp
+++ b/tests/invalid/ambiguous_method.err_exp
@@ -1,5 +1,5 @@
  ambiguous_method.m:018: In declaration for function `ambiguous_method.e'/0:
-ambiguous_method.m:018:   error in type class constraints: type variable E
+ambiguous_method.m:018:   error in type class constraints: type variable `E'
  ambiguous_method.m:018:   occurs in the constraints, but is not determined by
  ambiguous_method.m:018:   the function's argument or result types.
  ambiguous_method.m:018:   All types occurring in typeclass constraints must be
diff --git a/tests/invalid/ambiguous_method_2.err_exp b/tests/invalid/ambiguous_method_2.err_exp
index 1d21405..eb05763 100644
--- a/tests/invalid/ambiguous_method_2.err_exp
+++ b/tests/invalid/ambiguous_method_2.err_exp
@@ -1,5 +1,5 @@
  ambiguous_method_2.m:028: In declaration for function `ambiguous_method_2.e'/0:
-ambiguous_method_2.m:028:   error in type class constraints: type variable E
+ambiguous_method_2.m:028:   error in type class constraints: type variable `E'
  ambiguous_method_2.m:028:   occurs in the constraints, but is not determined by
  ambiguous_method_2.m:028:   the function's argument or result types.
  For more information, recompile with `-E'.
diff --git a/tests/invalid/anys_in_negated_contexts.err_exp b/tests/invalid/anys_in_negated_contexts.err_exp
index 5aa5e46..0a76dfe 100644
--- a/tests/invalid/anys_in_negated_contexts.err_exp
+++ b/tests/invalid/anys_in_negated_contexts.err_exp
@@ -1,13 +1,13 @@
  anys_in_negated_contexts.m:038: In clause for `bad_if_then_else1(ia, out)':
  anys_in_negated_contexts.m:038:   purity error: if-then-else should be inside a
  anys_in_negated_contexts.m:038:   promise_purity scope because non-local
-anys_in_negated_contexts.m:038:   variable X has inst any and appears in the
-anys_in_negated_contexts.m:038:   condition.
+anys_in_negated_contexts.m:038:   variable `X' has inst `any' and appears in
+anys_in_negated_contexts.m:038:   the condition.
  anys_in_negated_contexts.m:049: In clause for `bad_negation1(ia)':
  anys_in_negated_contexts.m:049:   purity error: negation should be inside a
  anys_in_negated_contexts.m:049:   promise_purity scope because non-local
-anys_in_negated_contexts.m:049:   variable X has inst any and appears in the
-anys_in_negated_contexts.m:049:   body.
+anys_in_negated_contexts.m:049:   variable `X' has inst `any' and appears in
+anys_in_negated_contexts.m:049:   the body.
  anys_in_negated_contexts.m:071: In clause for `bad_lambda(in)':
  anys_in_negated_contexts.m:071:   mode error in conjunction. The next 2 error
  anys_in_negated_contexts.m:071:   messages indicate possible causes of this
diff --git a/tests/invalid/bigtest.err_exp b/tests/invalid/bigtest.err_exp
index f8dc492..b69a891 100644
--- a/tests/invalid/bigtest.err_exp
+++ b/tests/invalid/bigtest.err_exp
@@ -13,7 +13,7 @@ bigtest.m:002:   export_pred(((append / 3) , member)).
  bigtest.m:003: Error: unrecognized declaration:
  bigtest.m:003:   export_type(((list / 1) , bag)).
  bigtest.m:005: Error: clause for predicate `bigtest.fact'/0
-bigtest.m:005:   without preceding `pred' declaration.
+bigtest.m:005:   without preceding `:- pred' declaration.
  bigtest.m:005: Error: no mode declaration for predicate `fact'/0.
  bigtest.m:005:   (Use `--infer-modes' to enable mode inference.)
  bigtest.m:005: Inferred :- pred fact.
diff --git a/tests/invalid/bug113.err_exp b/tests/invalid/bug113.err_exp
index d002cd2..f09c360 100644
--- a/tests/invalid/bug113.err_exp
+++ b/tests/invalid/bug113.err_exp
@@ -2,10 +2,10 @@ bug113.m:001: In module `bug113':
  bug113.m:001:   warning: module `list' is imported in the interface, but is not
  bug113.m:001:   used in the interface.
  bug113.m:036: Error: clause for function `bug113.new'/1
-bug113.m:036:   without preceding `func' declaration.
+bug113.m:036:   without preceding `:- func' declaration.
  bug113.m:036: Inferred :- func new(T1) = T2.
  bug113.m:038: Error: clause for function `bug113.new'/2
-bug113.m:038:   without preceding `func' declaration.
+bug113.m:038:   without preceding `:- func' declaration.
  bug113.m:040: In clause for function `new'/2:
  bug113.m:040:   error: undefined symbol `throw_bitmap_error/1'.
  bug113.m:042: In clause for function `new'/2:
diff --git a/tests/invalid/bug197.err_exp b/tests/invalid/bug197.err_exp
index 97ea91a..ee7d959 100644
--- a/tests/invalid/bug197.err_exp
+++ b/tests/invalid/bug197.err_exp
@@ -1,6 +1,6 @@
  bug197.m:020: Error: no clauses for predicate `foo'/4.
  bug197.m:022: Error: clause for predicate `bug197.foo'/3
-bug197.m:022:   without preceding `pred' declaration.
+bug197.m:022:   without preceding `:- pred' declaration.
  bug197.m:023: In clause for predicate `foo'/3:
  bug197.m:023:   in argument 1 of call to predicate `list.foldl'/4:
  bug197.m:023:   type error: argument has type `pred(string, T, V_6, V_6)',
diff --git a/tests/invalid/complex_constraint_err.err_exp b/tests/invalid/complex_constraint_err.err_exp
index a978247..dff7d06 100644
--- a/tests/invalid/complex_constraint_err.err_exp
+++ b/tests/invalid/complex_constraint_err.err_exp
@@ -1,7 +1,7 @@
  complex_constraint_err.m:009: In declaration for predicate
  complex_constraint_err.m:009:   `complex_constraint_err.t'/1:
  complex_constraint_err.m:009:   error in type class constraints: type variable
-complex_constraint_err.m:009:   C occurs in the constraints, but is not
+complex_constraint_err.m:009:   `C' occurs in the constraints, but is not
  complex_constraint_err.m:009:   determined by the predicate's argument types.
  complex_constraint_err.m:009:   All types occurring in typeclass constraints
  complex_constraint_err.m:009:   must be fully determined. A type is fully
@@ -25,8 +25,9 @@ complex_constraint_err.m:009:   the reference manual for details.
  complex_constraint_err.m:013: In declaration for predicate
  complex_constraint_err.m:013:   `complex_constraint_err.u'/1:
  complex_constraint_err.m:013:   error in type class constraints: type variables
-complex_constraint_err.m:013:   Z and X occur in the constraints, but are not
-complex_constraint_err.m:013:   determined by the predicate's argument types.
+complex_constraint_err.m:013:   `Z' and `X' occur in the constraints, but are
+complex_constraint_err.m:013:   not determined by the predicate's argument
+complex_constraint_err.m:013:   types.
  complex_constraint_err.m:013:   All types occurring in typeclass constraints
  complex_constraint_err.m:013:   must be fully determined. A type is fully
  complex_constraint_err.m:013:   determined if one of the following holds:
diff --git a/tests/invalid/constrained_poly_insts.err_exp b/tests/invalid/constrained_poly_insts.err_exp
index 334e968..41f4b02 100644
--- a/tests/invalid/constrained_poly_insts.err_exp
+++ b/tests/invalid/constrained_poly_insts.err_exp
@@ -16,12 +16,12 @@ constrained_poly_insts.m:014:   (s((T :: in((I =< ground)))) = (T :: out((I =<
  constrained_poly_insts.m:014:   unique)))).
  constrained_poly_insts.m:023: Error: clause for predicate
  constrained_poly_insts.m:023:   `constrained_poly_insts.q'/2
-constrained_poly_insts.m:023:   without preceding `pred' declaration.
+constrained_poly_insts.m:023:   without preceding `:- pred' declaration.
  constrained_poly_insts.m:023: Error: no mode declaration for predicate `q'/2.
  constrained_poly_insts.m:023: Inferred :- pred q(T1, T1).
  constrained_poly_insts.m:025: Error: clause for function
  constrained_poly_insts.m:025:   `constrained_poly_insts.s'/1
-constrained_poly_insts.m:025:   without preceding `func' declaration.
+constrained_poly_insts.m:025:   without preceding `:- func' declaration.
  constrained_poly_insts.m:025: Inferred :- func s(T1) = T1.
  constrained_poly_insts.m:027: In clause for `t(in((I =< ground)), out((I =<
  constrained_poly_insts.m:027:   ground)))':
diff --git a/tests/invalid/errors.err_exp b/tests/invalid/errors.err_exp
index 405a654..01caddb 100644
--- a/tests/invalid/errors.err_exp
+++ b/tests/invalid/errors.err_exp
@@ -2,15 +2,15 @@ errors.m:001: Warning: interface for module `errors' does not export anything.
  errors.m:001: Warning: module `int' is imported using both `:- import_module'
  errors.m:001:   and `:- use_module' declarations.
  errors.m:010: Error: module must start with a `:- module' declaration.
-errors.m:028: Error: mode declaration for predicate
+errors.m:028: Error: `:- mode' declaration for predicate
  errors.m:028:   `errors.mode_declaration_without_pred_declaration'/0
-errors.m:028:   without preceding `pred' declaration.
-errors.m:032: Error: mode declaration for predicate
+errors.m:028:   without preceding `:- pred' declaration.
+errors.m:032: Error: `:- mode' declaration for predicate
  errors.m:032:   `errors.missing_pred_declaration'/0
-errors.m:032:   without preceding `pred' declaration.
+errors.m:032:   without preceding `:- pred' declaration.
  errors.m:038: Error: clause for predicate
  errors.m:038:   `errors.clause_without_pred_or_mode_declaration'/0
-errors.m:038:   without preceding `pred' declaration.
+errors.m:038:   without preceding `:- pred' declaration.
  errors.m:049: Error: constructor `errors.a/0' for type
  errors.m:049:   `errors.type_with_multiply_defined_ctors/0' multiply defined.
  errors.m:049: Error: constructor `errors.f/1' for type
diff --git a/tests/invalid/errors1.err_exp b/tests/invalid/errors1.err_exp
index 6229c61..799be00 100644
--- a/tests/invalid/errors1.err_exp
+++ b/tests/invalid/errors1.err_exp
@@ -1,14 +1,14 @@
  errors1.m:001: Warning: interface for module `errors1' does not export
  errors1.m:001:   anything.
-errors1.m:028: Error: mode declaration for predicate
+errors1.m:028: Error: `:- mode' declaration for predicate
  errors1.m:028:   `errors1.mode_declaration_without_pred_declaration'/0
-errors1.m:028:   without preceding `pred' declaration.
-errors1.m:032: Error: mode declaration for predicate
+errors1.m:028:   without preceding `:- pred' declaration.
+errors1.m:032: Error: `:- mode' declaration for predicate
  errors1.m:032:   `errors1.missing_pred_declaration'/0
-errors1.m:032:   without preceding `pred' declaration.
+errors1.m:032:   without preceding `:- pred' declaration.
  errors1.m:038: Error: clause for predicate
  errors1.m:038:   `errors1.clause_without_pred_or_mode_declaration'/0
-errors1.m:038:   without preceding `pred' declaration.
+errors1.m:038:   without preceding `:- pred' declaration.
  errors1.m:049: Error: constructor `errors1.a/0' for type
  errors1.m:049:   `errors1.type_with_multiply_defined_ctors/0' multiply defined.
  errors1.m:049: Error: constructor `errors1.f/1' for type
diff --git a/tests/invalid/errors2.err_exp b/tests/invalid/errors2.err_exp
index 4662105..c584898 100644
--- a/tests/invalid/errors2.err_exp
+++ b/tests/invalid/errors2.err_exp
@@ -7,7 +7,7 @@ errors2.m:001:   `:- pred', `:- func', `:- type', `:- inst' or `:- mode'
  errors2.m:001:   declaration.
  errors2.m:007: Error: no clauses for predicate `bind_type_param'/2.
  errors2.m:009: Error: clause for predicate `errors2.bind_type_param'/1
-errors2.m:009:   without preceding `pred' declaration.
+errors2.m:009:   without preceding `:- pred' declaration.
  errors2.m:009: Inferred :- pred bind_type_param(int).
  errors2.m:023: Error: no clauses for predicate `produce_string'/1.
  errors2.m:025: Error: no clauses for predicate `expect_int'/1.
diff --git a/tests/invalid/exported_mode.err_exp b/tests/invalid/exported_mode.err_exp
index 5ecf63a..33a992d 100644
--- a/tests/invalid/exported_mode.err_exp
+++ b/tests/invalid/exported_mode.err_exp
@@ -1,3 +1,4 @@
-exported_mode.m:004: Error: mode declaration for predicate `exported_mode.p'/2
-exported_mode.m:004:   without preceding `pred' declaration.
+exported_mode.m:004: Error: `:- mode' declaration for predicate
+exported_mode.m:004:   `exported_mode.p'/2
+exported_mode.m:004:   without preceding `:- pred' declaration.
  exported_mode.m:004: Inferred :- pred p(T1, string).
diff --git a/tests/invalid/funcs_as_preds.err_exp b/tests/invalid/funcs_as_preds.err_exp
index dcdb2ea..4bcd9bf 100644
--- a/tests/invalid/funcs_as_preds.err_exp
+++ b/tests/invalid/funcs_as_preds.err_exp
@@ -1,23 +1,23 @@
  funcs_as_preds.m:001: Warning: interface for module `funcs_as_preds' does not
  funcs_as_preds.m:001:   export anything.
  funcs_as_preds.m:017: Error: clause for function `funcs_as_preds.null'/1
-funcs_as_preds.m:017:   without preceding `func' declaration.
+funcs_as_preds.m:017:   without preceding `:- func' declaration.
  funcs_as_preds.m:017: In clause for function `null'/1:
  funcs_as_preds.m:017:   in function result term of clause head:
  funcs_as_preds.m:017:   error: the language construct `='/2 should be used as a
  funcs_as_preds.m:017:   goal, not as an expression.
  funcs_as_preds.m:021: Error: clause for function `funcs_as_preds.car'/1
-funcs_as_preds.m:021:   without preceding `func' declaration.
+funcs_as_preds.m:021:   without preceding `:- func' declaration.
  funcs_as_preds.m:021: Inferred :- func car(list.list(list.list(T))) =
  funcs_as_preds.m:021:   list.list(T).
  funcs_as_preds.m:024: Error: clause for function `funcs_as_preds.cdr'/1
-funcs_as_preds.m:024:   without preceding `func' declaration.
+funcs_as_preds.m:024:   without preceding `:- func' declaration.
  funcs_as_preds.m:024: Inferred :- func cdr(list.list(T)) = list.list(T).
  funcs_as_preds.m:027: Error: clause for function `funcs_as_preds.cons'/2
-funcs_as_preds.m:027:   without preceding `func' declaration.
+funcs_as_preds.m:027:   without preceding `:- func' declaration.
  funcs_as_preds.m:027: Inferred :- func cons(T, list.list(T)) = list.list(T).
  funcs_as_preds.m:030: Error: clause for function `funcs_as_preds.ap'/2
-funcs_as_preds.m:030:   without preceding `func' declaration.
+funcs_as_preds.m:030:   without preceding `:- func' declaration.
  funcs_as_preds.m:030: In clause for function `ap'/2:
  funcs_as_preds.m:030:   error: undefined predicate `null'/1.
  funcs_as_preds.m:030:   (There is a *function* with that name, however.
diff --git a/tests/invalid/fundeps_coverage.err_exp b/tests/invalid/fundeps_coverage.err_exp
index c2931be..e6c7d03 100644
--- a/tests/invalid/fundeps_coverage.err_exp
+++ b/tests/invalid/fundeps_coverage.err_exp
@@ -1,4 +1,4 @@
  fundeps_coverage.m:011: In instance for typeclass `fundeps_coverage.bar'/3:
-fundeps_coverage.m:011:   functional dependency not satisfied: type variable C
-fundeps_coverage.m:011:   occurs in the range of the functional dependency, but
-fundeps_coverage.m:011:   is not determined by the domain.
+fundeps_coverage.m:011:   functional dependency not satisfied: type variable
+fundeps_coverage.m:011:   `C' occurs in the range of the functional dependency,
+fundeps_coverage.m:011:   but is not determined by the domain.
diff --git a/tests/invalid/fundeps_unbound_in_ctor.err_exp b/tests/invalid/fundeps_unbound_in_ctor.err_exp
index ec5222f..81b05ac 100644
--- a/tests/invalid/fundeps_unbound_in_ctor.err_exp
+++ b/tests/invalid/fundeps_unbound_in_ctor.err_exp
@@ -1,7 +1,7 @@
  fundeps_unbound_in_ctor.m:008: In declaration for type
  fundeps_unbound_in_ctor.m:008:   `fundeps_unbound_in_ctor.bar'/0:
  fundeps_unbound_in_ctor.m:008:   error in type class constraints: type variable
-fundeps_unbound_in_ctor.m:008:   C occurs in the constraints, but is not
+fundeps_unbound_in_ctor.m:008:   `C' occurs in the constraints, but is not
  fundeps_unbound_in_ctor.m:008:   determined by the constructor's argument
  fundeps_unbound_in_ctor.m:008:   types.
  fundeps_unbound_in_ctor.m:008:   All types occurring in typeclass constraints
diff --git a/tests/invalid/fundeps_vars.err_exp b/tests/invalid/fundeps_vars.err_exp
index 8324b7c..922773d 100644
--- a/tests/invalid/fundeps_vars.err_exp
+++ b/tests/invalid/fundeps_vars.err_exp
@@ -3,7 +3,7 @@ fundeps_vars.m:020:   be comma-separated lists of variables.
  fundeps_vars.m:027: Error: type variable F in the functional dependency is not
  fundeps_vars.m:027:   a parameter of this type class.
  fundeps_vars.m:035: Error: instance declaration for `coll'/2 without preceding
-fundeps_vars.m:035:   typeclass declaration.
+fundeps_vars.m:035:   `:- typeclass' declaration.
  fundeps_vars.m:035: In declaration of instance of typeclass `coll'/2:
  fundeps_vars.m:035:   error: undefined typeclass `coll'/2.
  fundeps_vars.m:042: In definition of predicate `fundeps_vars.test'/2:
diff --git a/tests/invalid/imported_mode.err_exp b/tests/invalid/imported_mode.err_exp
index c7b02d0..a563a39 100644
--- a/tests/invalid/imported_mode.err_exp
+++ b/tests/invalid/imported_mode.err_exp
@@ -1,4 +1,4 @@
  exported_mode.int:003: Error: mode declaration for predicate
  exported_mode.int:003:   `exported_mode.p'/2
-exported_mode.int:003:   without preceding `pred' declaration.
+exported_mode.int:003:   without preceding `:- pred' declaration.
  exported_mode.int:003: Inferred :- pred p(T1, T2).
diff --git a/tests/invalid/multimode_syntax.err_exp b/tests/invalid/multimode_syntax.err_exp
index 9778d40..2d7bc94 100644
--- a/tests/invalid/multimode_syntax.err_exp
+++ b/tests/invalid/multimode_syntax.err_exp
@@ -1,6 +1,6 @@
  multimode_syntax.m:011: Error: no clauses for function `func0'/0.
  multimode_syntax.m:013: Error: clause for predicate `multimode_syntax.::'/2
-multimode_syntax.m:013:   without preceding `pred' declaration.
+multimode_syntax.m:013:   without preceding `:- pred' declaration.
  multimode_syntax.m:013: In clause for predicate `::'/2:
  multimode_syntax.m:013:   in argument 1 of clause head:
  multimode_syntax.m:013:   error: the language construct `='/2 should be used as
diff --git a/tests/invalid/null_char.err_exp b/tests/invalid/null_char.err_exp
index e458459..b24007d 100644
--- a/tests/invalid/null_char.err_exp
+++ b/tests/invalid/null_char.err_exp
@@ -1,6 +1,6 @@
  null_char.m:012: Syntax error: null character is illegal in strings and names.
  null_char.m:012: Error: clause for predicate `null_char.int'/0
-null_char.m:012:   without preceding `pred' declaration.
+null_char.m:012:   without preceding `:- pred' declaration.
  null_char.m:012: Inferred :- pred int.
  null_char.m:014: In clause head: error: atom expected at 1.
  null_char.m:014: Syntax error: null character is illegal in strings and names.
diff --git a/tests/invalid/purity/purity_nonsense.err_exp b/tests/invalid/purity/purity_nonsense.err_exp
index d217a65..b9aff46 100644
--- a/tests/invalid/purity/purity_nonsense.err_exp
+++ b/tests/invalid/purity/purity_nonsense.err_exp
@@ -1,5 +1,5 @@
  purity_nonsense.m:012: Error: clause for predicate `purity_nonsense.e12'/0
-purity_nonsense.m:012:   without preceding `pred' declaration.
+purity_nonsense.m:012:   without preceding `:- pred' declaration.
  purity_nonsense.m:012: In clause for predicate `e12'/0:
  purity_nonsense.m:012:   error: `impure' marker in an inappropriate place.
  purity_nonsense.m:012: In clause for predicate `e12'/0:
@@ -17,7 +17,7 @@ purity_nonsense.m:012:   in argument 1 of functor `\\+/1':
  purity_nonsense.m:012:   in argument 1 of functor `impure/1':
  purity_nonsense.m:012:   error: undefined symbol `imp/0'.
  purity_nonsense.m:013: Error: clause for predicate `purity_nonsense.e13'/0
-purity_nonsense.m:013:   without preceding `pred' declaration.
+purity_nonsense.m:013:   without preceding `:- pred' declaration.
  purity_nonsense.m:013: In clause for predicate `e13'/0:
  purity_nonsense.m:013:   error: `semipure' marker in an inappropriate place.
  purity_nonsense.m:013: In clause for predicate `e13'/0:
diff --git a/tests/invalid/purity/purity_nonsense2.err_exp b/tests/invalid/purity/purity_nonsense2.err_exp
index 3315690..498565e 100644
--- a/tests/invalid/purity/purity_nonsense2.err_exp
+++ b/tests/invalid/purity/purity_nonsense2.err_exp
@@ -4,8 +4,8 @@ purity_nonsense2.m:006: Syntax error at token 'mode': unexpected token at start
  purity_nonsense2.m:006:   of (sub)term.
  purity_nonsense2.m:010: Error: `:- pragma promise_pure' declaration for
  purity_nonsense2.m:010:   `purity_nonsense2.undefined2'/0 without corresponding
-purity_nonsense2.m:010:   `pred' or `func' declaration.
+purity_nonsense2.m:010:   `:- pred' or `:- func' declaration.
  purity_nonsense2.m:012: Error: clause for predicate `purity_nonsense2.e12'/0
-purity_nonsense2.m:012:   without preceding `pred' declaration.
+purity_nonsense2.m:012:   without preceding `:- pred' declaration.
  purity_nonsense2.m:013: Error: clause for predicate `purity_nonsense2.e13'/0
-purity_nonsense2.m:013:   without preceding `pred' declaration.
+purity_nonsense2.m:013:   without preceding `:- pred' declaration.
diff --git a/tests/invalid/quant_constraint_1.err_exp b/tests/invalid/quant_constraint_1.err_exp
index b9737cf..8c7e2f5 100644
--- a/tests/invalid/quant_constraint_1.err_exp
+++ b/tests/invalid/quant_constraint_1.err_exp
@@ -1,6 +1,6 @@
  quant_constraint_1.m:015: In declaration of predicate `quant_constraint_1.p'/2:
-quant_constraint_1.m:015:   type variable T1 is existentially constrained, but
-quant_constraint_1.m:015:   is universally quantified.
+quant_constraint_1.m:015:   type variable `T1' is existentially constrained,
+quant_constraint_1.m:015:   but is universally quantified.
  quant_constraint_1.m:015: In declaration of predicate `quant_constraint_1.p'/2:
-quant_constraint_1.m:015:   type variable T2 is universally constrained, but is
-quant_constraint_1.m:015:   existentially quantified.
+quant_constraint_1.m:015:   type variable `T2' is universally constrained, but
+quant_constraint_1.m:015:   is existentially quantified.
diff --git a/tests/invalid/quant_constraint_2.err_exp b/tests/invalid/quant_constraint_2.err_exp
index def055e..7d2db84 100644
--- a/tests/invalid/quant_constraint_2.err_exp
+++ b/tests/invalid/quant_constraint_2.err_exp
@@ -1,3 +1,3 @@
  quant_constraint_2.m:012: In declaration of function `quant_constraint_2.q'/0:
-quant_constraint_2.m:012:   type variable T is universally constrained, but is
-quant_constraint_2.m:012:   existentially quantified.
+quant_constraint_2.m:012:   type variable `T' is universally constrained, but
+quant_constraint_2.m:012:   is existentially quantified.
diff --git a/tests/invalid/range_restrict.err_exp b/tests/invalid/range_restrict.err_exp
index 04aaa6d..e6ee111 100644
--- a/tests/invalid/range_restrict.err_exp
+++ b/tests/invalid/range_restrict.err_exp
@@ -1,4 +1,4 @@
  range_restrict.m:010: In instance for typeclass `range_restrict.foo'/2:
-range_restrict.m:010:   functional dependency not satisfied: type variables Y
-range_restrict.m:010:   and Z occur in the range of the functional dependency,
-range_restrict.m:010:   but are not determined by the domain.
+range_restrict.m:010:   functional dependency not satisfied: type variables `Y'
+range_restrict.m:010:   and `Z' occur in the range of the functional
+range_restrict.m:010:   dependency, but are not determined by the domain.
diff --git a/tests/invalid/record_syntax_errors.err_exp b/tests/invalid/record_syntax_errors.err_exp
index ef0234c..8bf36f1 100644
--- a/tests/invalid/record_syntax_errors.err_exp
+++ b/tests/invalid/record_syntax_errors.err_exp
@@ -1,8 +1,8 @@
  record_syntax_errors.m:014: Error: no clauses for predicate `dcg_syntax'/2.
  record_syntax_errors.m:016: Error: no clauses for predicate `dcg_syntax_2'/2.
-record_syntax_errors.m:023: Error: mode declaration for function
+record_syntax_errors.m:023: Error: `:- mode' declaration for function
  record_syntax_errors.m:023:   `record_syntax_errors.field8'/1
-record_syntax_errors.m:023:   without preceding `func' declaration.
+record_syntax_errors.m:023:   without preceding `:- func' declaration.
  record_syntax_errors.m:023: Inferred :- func field8(record_syntax_errors.cons2)
  record_syntax_errors.m:023:   = int.
  record_syntax_errors.m:028: In DCG field update goal:
@@ -27,7 +27,7 @@ record_syntax_errors.m:046:   Argument 2 has type `string',
  record_syntax_errors.m:046:   expected type was `int'.
  record_syntax_errors.m:048: Error: clause for predicate
  record_syntax_errors.m:048:   `record_syntax_errors.term_type_error'/1
-record_syntax_errors.m:048:   without preceding `pred' declaration.
+record_syntax_errors.m:048:   without preceding `:- pred' declaration.
  record_syntax_errors.m:050: In clause for predicate `term_type_error'/1:
  record_syntax_errors.m:050:   in argument 2 of functor `field6 :=/2':
  record_syntax_errors.m:050:   in unification of argument
diff --git a/tests/invalid/ref_to_implicit_pred.err_exp b/tests/invalid/ref_to_implicit_pred.err_exp
index f153182..29038df 100644
--- a/tests/invalid/ref_to_implicit_pred.err_exp
+++ b/tests/invalid/ref_to_implicit_pred.err_exp
@@ -3,7 +3,7 @@ ref_to_implicit_pred.m:004:   error: determinism declaration not satisfied.
  ref_to_implicit_pred.m:004:   Declared `det', inferred `failure'.
  ref_to_implicit_pred.m:009: Error: clause for predicate
  ref_to_implicit_pred.m:009:   `ref_to_implicit_pred.p'/2
-ref_to_implicit_pred.m:009:   without preceding `pred' declaration.
+ref_to_implicit_pred.m:009:   without preceding `:- pred' declaration.
  ref_to_implicit_pred.m:009: Error: no mode declaration for predicate `p'/2.
  ref_to_implicit_pred.m:009: Inferred :- pred p((pred), (pred)).
  ref_to_implicit_pred.m:010: Error: reference to undeclared function or
diff --git a/tests/invalid/specified.err_exp b/tests/invalid/specified.err_exp
index 1976ed1..cc3a2a9 100644
--- a/tests/invalid/specified.err_exp
+++ b/tests/invalid/specified.err_exp
@@ -1,16 +1,16 @@
-specified.m:138: Error in `pragma memo' declaration for predicate
+specified.m:138: Error in `:- pragma memo' declaration for predicate
  specified.m:138:   `specified.ap_lp_fib'/3:
  specified.m:138:   argument 3: argument tabling method `addr' is not compatible
  specified.m:138:   with output modes.
  specified.m:155: Error: expected argument tabling method, not `implied'.
-specified.m:170: Error in `pragma memo' declaration for predicate
+specified.m:170: Error in `:- pragma memo' declaration for predicate
  specified.m:170:   `specified.ap_li_fib'/3:
  specified.m:170:   not enough argument tabling methods specified.
-specified.m:210: Error in `pragma memo' declaration for predicate
+specified.m:210: Error in `:- pragma memo' declaration for predicate
  specified.m:210:   `specified.vp_ll_fib'/3:
  specified.m:210:   argument 1: argument tabling method `output' is not
  specified.m:210:   compatible with input modes.
-specified.m:230: Error in `pragma memo' declaration for predicate
+specified.m:230: Error in `:- pragma memo' declaration for predicate
  specified.m:230:   `specified.vv_ll_fib'/3:
  specified.m:230:   too many argument tabling methods specified.
  specified.m:274: Error: expected one or two arguments for `specified'.
diff --git a/tests/invalid/state_vars_test3.err_exp b/tests/invalid/state_vars_test3.err_exp
index 424f9a1..d0bbccf 100644
--- a/tests/invalid/state_vars_test3.err_exp
+++ b/tests/invalid/state_vars_test3.err_exp
@@ -2,5 +2,5 @@ state_vars_test3.m:015: Error: no clauses for function `f'/1.
  state_vars_test3.m:021: Error: !Y cannot be a function result.
  state_vars_test3.m:021:   You probably meant !.Y or !:Y.
  state_vars_test3.m:021: Error: clause for function `state_vars_test3.f'/2
-state_vars_test3.m:021:   without preceding `func' declaration.
+state_vars_test3.m:021:   without preceding `:- func' declaration.
  state_vars_test3.m:021: Error: no clauses for function `f'/2.
diff --git a/tests/invalid/type_inf_loop.err_exp b/tests/invalid/type_inf_loop.err_exp
index 49101d6..aaa8e75 100644
--- a/tests/invalid/type_inf_loop.err_exp
+++ b/tests/invalid/type_inf_loop.err_exp
@@ -5,7 +5,7 @@ Type inference iteration limit exceeded. This probably indicates that your
  type_inf_loop.m:001: Warning: interface for module `type_inf_loop' does not
  type_inf_loop.m:001:   export anything.
  type_inf_loop.m:004: Error: clause for predicate `type_inf_loop.loop'/1
-type_inf_loop.m:004:   without preceding `pred' declaration.
+type_inf_loop.m:004:   without preceding `:- pred' declaration.
  type_inf_loop.m:004: Inferred :- pred loop((pred (pred (pred (pred (pred (pred
  type_inf_loop.m:004:   (pred (pred (pred (pred (pred (pred (pred (pred (pred
  type_inf_loop.m:004:   (pred (pred (pred (pred (pred (pred (pred (pred (pred
diff --git a/tests/invalid/type_spec.err_exp b/tests/invalid/type_spec.err_exp
index 343b450..54dc05a 100644
--- a/tests/invalid/type_spec.err_exp
+++ b/tests/invalid/type_spec.err_exp
@@ -5,8 +5,8 @@ type_spec.m:010:   declaration.
  type_spec.m:011: Error: `:- pragma type_spec' declaration for
  type_spec.m:011:   `type_spec.type_spec1'/1 specifies non-existent mode.
  type_spec.m:013: Error: `:- pragma type_spec' declaration for
-type_spec.m:013:   `type_spec.type_spec1'/2 without corresponding `pred' or
-type_spec.m:013:   `func' declaration.
+type_spec.m:013:   `type_spec.type_spec1'/2 without corresponding `:- pred' or
+type_spec.m:013:   `:- func' declaration.
  type_spec.m:024: In `:- pragma type_spec' declaration for predicate
  type_spec.m:024:   `type_spec.type_spec2'/1:
  type_spec.m:024:   error: the substitution includes the existentially
diff --git a/tests/invalid/type_vars.err_exp b/tests/invalid/type_vars.err_exp
index 6c650ca..8affd54 100644
--- a/tests/invalid/type_vars.err_exp
+++ b/tests/invalid/type_vars.err_exp
@@ -1,7 +1,7 @@
  type_vars.m:006: In declaration for type `type_vars.t1'/0:
-type_vars.m:006:   error in type class constraints: type variable T2 occurs in
-type_vars.m:006:   the constraints, but is not determined by the constructor's
-type_vars.m:006:   argument types.
+type_vars.m:006:   error in type class constraints: type variable `T2' occurs
+type_vars.m:006:   in the constraints, but is not determined by the
+type_vars.m:006:   constructor's argument types.
  type_vars.m:006:   All types occurring in typeclass constraints must be fully
  type_vars.m:006:   determined. A type is fully determined if one of the
  type_vars.m:006:   following holds:
@@ -19,8 +19,8 @@ type_vars.m:006:   See the "Functional dependencies" section of the reference
  type_vars.m:006:   manual for details.
  type_vars.m:007: Error: type variable T2 in existential quantifier does not
  type_vars.m:007:   occur in arguments or constraints of constructor.
-type_vars.m:008: Error: type variable T1 has overlapping scopes (explicit type
-type_vars.m:008:   quantifier shadows argument type).
+type_vars.m:008: Error: type variable `T1' has overlapping scopes (explicit
+type_vars.m:008:   type quantifier shadows argument type).
  type_vars.m:009: Error: type variable T2 in class constraints, which was
  type_vars.m:009:   introduced with `=>' must be explicitly existentially
  type_vars.m:009:   quantified using `some'.
diff --git a/tests/invalid/typeclass_constraint_extra_var.err_exp b/tests/invalid/typeclass_constraint_extra_var.err_exp
index 1cae4de..b1b01a0 100644
--- a/tests/invalid/typeclass_constraint_extra_var.err_exp
+++ b/tests/invalid/typeclass_constraint_extra_var.err_exp
@@ -1,7 +1,7 @@
  typeclass_constraint_extra_var.m:011: In declaration for predicate
  typeclass_constraint_extra_var.m:011:   `typeclass_constraint_extra_var.mg'/2:
  typeclass_constraint_extra_var.m:011:   error in type class constraints: type
-typeclass_constraint_extra_var.m:011:   variable U occurs in the constraints,
+typeclass_constraint_extra_var.m:011:   variable `U' occurs in the constraints,
  typeclass_constraint_extra_var.m:011:   but is not determined by the
  typeclass_constraint_extra_var.m:011:   predicate's argument types.
  typeclass_constraint_extra_var.m:011:   All types occurring in typeclass
diff --git a/tests/invalid/typeclass_mode_2.err_exp b/tests/invalid/typeclass_mode_2.err_exp
index 8258dfc..460afee 100644
--- a/tests/invalid/typeclass_mode_2.err_exp
+++ b/tests/invalid/typeclass_mode_2.err_exp
@@ -2,7 +2,7 @@ typeclass_mode_2.m:005: Error: mode declaration for type class method
  typeclass_mode_2.m:005:   `typeclass_mode_2.p'/1 without corresponding
  typeclass_mode_2.m:005:   predicate method declaration.
  typeclass_mode_2.m:010: Error: clause for predicate `typeclass_mode_2.p'/1
-typeclass_mode_2.m:010:   without preceding `pred' declaration.
+typeclass_mode_2.m:010:   without preceding `:- pred' declaration.
  typeclass_mode_2.m:010: Error: no mode declaration for predicate `p'/1.
  typeclass_mode_2.m:010: Inferred :- pred p(T1).
  For more information, recompile with `-E'.
diff --git a/tests/invalid/typeclass_test_12.err_exp b/tests/invalid/typeclass_test_12.err_exp
index 4567534..55a392d 100644
--- a/tests/invalid/typeclass_test_12.err_exp
+++ b/tests/invalid/typeclass_test_12.err_exp
@@ -1,5 +1,5 @@
  typeclass_test_12.m:003: In declaration for predicate `typeclass_test_12.p'/0:
-typeclass_test_12.m:003:   error in type class constraints: type variable T
+typeclass_test_12.m:003:   error in type class constraints: type variable `T'
  typeclass_test_12.m:003:   occurs in the constraints, but is not determined by
  typeclass_test_12.m:003:   the predicate's argument types.
  typeclass_test_12.m:003:   All types occurring in typeclass constraints must be
@@ -22,7 +22,7 @@ typeclass_test_12.m:003:   determined.
  typeclass_test_12.m:003:   See the "Functional dependencies" section of the
  typeclass_test_12.m:003:   reference manual for details.
  typeclass_test_12.m:005: In declaration for function `typeclass_test_12.q'/0:
-typeclass_test_12.m:005:   error in type class constraints: type variable T
+typeclass_test_12.m:005:   error in type class constraints: type variable `T'
  typeclass_test_12.m:005:   occurs in the constraints, but is not determined by
  typeclass_test_12.m:005:   the function's argument or result types.
  typeclass_test_12.m:005:   All types occurring in typeclass constraints must be
diff --git a/tests/invalid/typeclass_test_2.err_exp b/tests/invalid/typeclass_test_2.err_exp
index 43531c5..e7cafe0 100644
--- a/tests/invalid/typeclass_test_2.err_exp
+++ b/tests/invalid/typeclass_test_2.err_exp
@@ -7,5 +7,5 @@ typeclass_test_2.m:020:   `func(<Name> / <Arity>) is <InstanceName>', not
  typeclass_test_2.m:020:   ((type_num / 0) is foo_type_num).
  typeclass_test_2.m:023: Error: clause for function
  typeclass_test_2.m:023:   `typeclass_test_2.foo_type_num'/1
-typeclass_test_2.m:023:   without preceding `func' declaration.
+typeclass_test_2.m:023:   without preceding `:- func' declaration.
  typeclass_test_2.m:023: Inferred :- func foo_type_num(T1) = int.
diff --git a/tests/invalid/types.err_exp b/tests/invalid/types.err_exp
index 50c619c..c32f561 100644
--- a/tests/invalid/types.err_exp
+++ b/tests/invalid/types.err_exp
@@ -8,6 +8,6 @@ types.m:003:   defined.
  types.m:003: Error: constructor `types.f/1' for type `types.t/0' multiply
  types.m:003:   defined.
  types.m:017: Error: clause for predicate `types.r'/0
-types.m:017:   without preceding `pred' declaration.
+types.m:017:   without preceding `:- pred' declaration.
  types.m:020: Error: clause for predicate `types.a'/1
-types.m:020:   without preceding `pred' declaration.
+types.m:020:   without preceding `:- pred' declaration.
diff --git a/tests/invalid/types2.err_exp b/tests/invalid/types2.err_exp
index e63c259..832d352 100644
--- a/tests/invalid/types2.err_exp
+++ b/tests/invalid/types2.err_exp
@@ -12,14 +12,14 @@ types2.m:014: In clause for predicate `q'/0:
  types2.m:014:   error: wrong number of arguments (0; should be 1)
  types2.m:014:   in call to predicate `p'.
  types2.m:017: Error: clause for predicate `types2.r'/0
-types2.m:017:   without preceding `pred' declaration.
+types2.m:017:   without preceding `:- pred' declaration.
  types2.m:017: Warning: non-contiguous clauses for predicate `r'/0.
  types2.m:017:   Gap in clauses of predicate `r'/0 starts after this clause.
  types2.m:022:   Gap in clauses of predicate `r'/0 ends with this clause.
  types2.m:018: In clause for predicate `r'/0:
  types2.m:018:   error: undefined predicate `s'/0.
  types2.m:020: Error: clause for predicate `types2.a'/1
-types2.m:020:   without preceding `pred' declaration.
+types2.m:020:   without preceding `:- pred' declaration.
  types2.m:020: In clause for predicate `a'/1:
  types2.m:020:   error: undefined predicate `b'/1.
  types2.m:039: In clause for predicate `bar'/1:
diff --git a/tests/invalid/unbound_type_vars.err_exp b/tests/invalid/unbound_type_vars.err_exp
index 53fa414..f439160 100644
--- a/tests/invalid/unbound_type_vars.err_exp
+++ b/tests/invalid/unbound_type_vars.err_exp
@@ -3,7 +3,7 @@ unbound_type_vars.m:014:   is not a parameter of this type class.
  unbound_type_vars.m:018: Error: unbound type variable T1 in constraints on
  unbound_type_vars.m:018:   instance declaration.
  unbound_type_vars.m:021: In declaration for predicate `unbound_type_vars.p1'/1:
-unbound_type_vars.m:021:   error in type class constraints: type variable T2
+unbound_type_vars.m:021:   error in type class constraints: type variable `T2'
  unbound_type_vars.m:021:   occurs in the constraints, but is not determined by
  unbound_type_vars.m:021:   the predicate's argument types.
  unbound_type_vars.m:021:   All types occurring in typeclass constraints must be
@@ -26,7 +26,7 @@ unbound_type_vars.m:021:   determined.
  unbound_type_vars.m:021:   See the "Functional dependencies" section of the
  unbound_type_vars.m:021:   reference manual for details.
  unbound_type_vars.m:024: In declaration for predicate `unbound_type_vars.p2'/2:
-unbound_type_vars.m:024:   error in type class constraints: type variable T3
+unbound_type_vars.m:024:   error in type class constraints: type variable `T3'
  unbound_type_vars.m:024:   occurs in the constraints, but is not determined by
  unbound_type_vars.m:024:   the predicate's argument types.
  unbound_type_vars.m:024:   All types occurring in typeclass constraints must be
@@ -49,7 +49,7 @@ unbound_type_vars.m:024:   determined.
  unbound_type_vars.m:024:   See the "Functional dependencies" section of the
  unbound_type_vars.m:024:   reference manual for details.
  unbound_type_vars.m:028: In declaration for predicate `unbound_type_vars.p3'/1:
-unbound_type_vars.m:028:   error in type class constraints: type variable T2
+unbound_type_vars.m:028:   error in type class constraints: type variable `T2'
  unbound_type_vars.m:028:   occurs in the constraints, but is not determined by
  unbound_type_vars.m:028:   the predicate's argument types.
  unbound_type_vars.m:028:   All types occurring in typeclass constraints must be
@@ -72,7 +72,7 @@ unbound_type_vars.m:028:   determined.
  unbound_type_vars.m:028:   See the "Functional dependencies" section of the
  unbound_type_vars.m:028:   reference manual for details.
  unbound_type_vars.m:031: In declaration for predicate `unbound_type_vars.p4'/1:
-unbound_type_vars.m:031:   error in type class constraints: type variable T2
+unbound_type_vars.m:031:   error in type class constraints: type variable `T2'
  unbound_type_vars.m:031:   occurs in the constraints, but is not determined by
  unbound_type_vars.m:031:   the predicate's argument types.
  unbound_type_vars.m:031:   All types occurring in typeclass constraints must be
@@ -95,7 +95,7 @@ unbound_type_vars.m:031:   determined.
  unbound_type_vars.m:031:   See the "Functional dependencies" section of the
  unbound_type_vars.m:031:   reference manual for details.
  unbound_type_vars.m:034: In declaration for predicate `unbound_type_vars.p5'/1:
-unbound_type_vars.m:034:   error in type class constraints: type variable T2
+unbound_type_vars.m:034:   error in type class constraints: type variable `T2'
  unbound_type_vars.m:034:   occurs in the constraints, but is not determined by
  unbound_type_vars.m:034:   the predicate's argument types.
  unbound_type_vars.m:034:   All types occurring in typeclass constraints must be
@@ -118,5 +118,5 @@ unbound_type_vars.m:034:   determined.
  unbound_type_vars.m:034:   See the "Functional dependencies" section of the
  unbound_type_vars.m:034:   reference manual for details.
  unbound_type_vars.m:034: In declaration of predicate `unbound_type_vars.p5'/1:
-unbound_type_vars.m:034:   type variable T2 is universally constrained, but is
-unbound_type_vars.m:034:   existentially quantified.
+unbound_type_vars.m:034:   type variable `T2' is universally constrained, but
+unbound_type_vars.m:034:   is existentially quantified.
diff --git a/tests/invalid/with_type.err_exp b/tests/invalid/with_type.err_exp
index 9ac6cd0..d8f64b1 100644
--- a/tests/invalid/with_type.err_exp
+++ b/tests/invalid/with_type.err_exp
@@ -6,8 +6,9 @@ with_type.m:013:   error: expected higher order inst after `with_inst`.
  with_type.m:018: In type declaration for function `with_type.with_type_2':
  with_type.m:018:   error: expected higher order function type after
  with_type.m:018:   `with_type`.
-with_type.m:019: Error: mode declaration for function `with_type.with_type_2'/3
-with_type.m:019:   without preceding `func' declaration.
+with_type.m:019: Error: `:- mode' declaration for function
+with_type.m:019:   `with_type.with_type_2'/3
+with_type.m:019:   without preceding `:- func' declaration.
  with_type.m:021: In type declaration for predicate `with_type.with_type_3':
  with_type.m:021:   error: the `with_type` and `with_inst` annotations are
  with_type.m:021:   incompatible.
diff --git a/tests/warnings/non_term_user_special.exp b/tests/warnings/non_term_user_special.exp
index e445ede..ad2331c 100644
--- a/tests/warnings/non_term_user_special.exp
+++ b/tests/warnings/non_term_user_special.exp
@@ -1,9 +1,9 @@
  non_term_user_special.m:007: Warning: the user-defined equality predicate for
-non_term_user_special.m:007:   the type non_term_user_special.myset/1 cannot be
-non_term_user_special.m:007:   proven to terminate.
+non_term_user_special.m:007:   the type `non_term_user_special.myset'/1 cannot
+non_term_user_special.m:007:   be proven to terminate.
  non_term_user_special.m:007: Warning: the user-defined comparison predicate for
-non_term_user_special.m:007:   the type non_term_user_special.myset/1 cannot be
-non_term_user_special.m:007:   proven to terminate.
+non_term_user_special.m:007:   the type `non_term_user_special.myset'/1 cannot
+non_term_user_special.m:007:   be proven to terminate.
  non_term_user_special.m:039: Warning: the user-defined initialisation predicate
-non_term_user_special.m:039:   for the type non_term_user_special.foo/1 cannot
-non_term_user_special.m:039:   be proven to terminate.
+non_term_user_special.m:039:   for the type `non_term_user_special.foo'/1
+non_term_user_special.m:039:   cannot be proven to terminate.



More information about the reviews mailing list