[m-rev.] diff: formatting of type error messages
Zoltan Somogyi
zs at csse.unimelb.edu.au
Fri Apr 1 19:43:20 AEDT 2011
compiler/typecheck_errors.m:
When printing a type, allow the string representing that type
to be broken up into words.
Zoltan.
cvs diff: Diffing .
Index: det_report.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.153
diff -u -b -r1.153 det_report.m
Index: typecheck_errors.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck_errors.m,v
retrieving revision 1.49
diff -u -b -r1.49 typecheck_errors.m
--- typecheck_errors.m 2 Jan 2011 14:37:59 -0000 1.49
+++ typecheck_errors.m 27 Mar 2011 06:42:11 -0000
@@ -1430,10 +1430,8 @@
Context = Info ^ tc_info_context,
typecheck_info_get_predid(Info, PredId),
Pieces = [words("The foreign language code for") |
- describe_one_pred_name(ModuleInfo, should_module_qualify,
- PredId)] ++
- [words("should define the variable"),
- fixed(add_quotes(VarName)), suffix(".")],
+ describe_one_pred_name(ModuleInfo, should_module_qualify, PredId)] ++
+ [words("should define the variable"), quote(VarName), suffix(".")],
Spec = error_spec(severity_error, phase_type_check,
[simple_msg(Context, [always(Pieces)])]).
@@ -1488,7 +1486,7 @@
TypeStrs0 = list.map(typestuff_to_typestr, TypeStuffList),
list.sort_and_remove_dups(TypeStrs0, TypeStrs),
( TypeStrs = [TypeStr] ->
- Pieces = [words("has type"), quote(TypeStr)]
+ Pieces = [words("has type"), words(add_quotes(TypeStr))]
;
Pieces = [words("has overloaded type {"), nl_indent_delta(2)] ++
types_list_to_pieces(TypeStrs) ++ [nl_indent_delta(-2), words("}")]
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list