[m-rev.] diff: fix detism error message
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Dec 27 14:56:01 AEDT 2004
compiler/det_report.m:
Fix a problem with the formatting of some error messages.
tests/invalid/det_errors.{m,exp}:
Add to this test case a test for the new fix.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.91
diff -u -r1.91 det_report.m
--- compiler/det_report.m 10 Dec 2004 07:03:43 -0000 1.91
+++ compiler/det_report.m 26 Dec 2004 14:20:48 -0000
@@ -563,11 +563,9 @@
->
map__keys(ConsTable, ConsIds),
det_diagnose_missing_consids(ConsIds, Cases, Missing),
- cons_id_list_to_pieces(Missing, yes, MissingPieces),
- list__append(MissingPieces, [words(".")],
- PiecesTail),
+ cons_id_list_to_pieces(Missing, MissingPieces),
Pieces = [words("The switch on "), fixed(VarStr),
- words("does not cover") | PiecesTail]
+ words("does not cover") | MissingPieces]
;
Pieces = [words("The switch on "), fixed(VarStr),
words("can fail.")]
@@ -815,20 +813,20 @@
Missing = [ConsId | Missing0]
).
-:- pred cons_id_list_to_pieces(list(cons_id)::in, bool::in,
+:- pred cons_id_list_to_pieces(list(cons_id)::in,
list(format_component)::out) is det.
-cons_id_list_to_pieces([], _, []).
-cons_id_list_to_pieces([ConsId | ConsIds], First, Pieces) :-
+cons_id_list_to_pieces([], []).
+cons_id_list_to_pieces([ConsId | ConsIds], Pieces) :-
ConsIdStr = cons_id_to_string(ConsId),
- ( First = yes ->
- PiecesHead = [words(ConsIdStr)]
- ; ConsIds = [] ->
- PiecesHead = [words(ConsIdStr), words(" and/or ")]
+ ( ConsIds = [] ->
+ PiecesHead = [fixed(ConsIdStr ++ ".")]
+ ; ConsIds = [_] ->
+ PiecesHead = [fixed(ConsIdStr), fixed("or")]
;
- PiecesHead = [words(ConsIdStr ++ ",")]
+ PiecesHead = [fixed(ConsIdStr ++ ",")]
),
- cons_id_list_to_pieces(ConsIds, no, PiecesTail),
+ cons_id_list_to_pieces(ConsIds, PiecesTail),
list__append(PiecesHead, PiecesTail, Pieces).
%-----------------------------------------------------------------------------%
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
Index: tests/invalid/det_errors.err_exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/invalid/det_errors.err_exp,v
retrieving revision 1.1
diff -u -r1.1 det_errors.err_exp
--- tests/invalid/det_errors.err_exp 4 Nov 1996 07:14:37 -0000 1.1
+++ tests/invalid/det_errors.err_exp 26 Dec 2004 15:40:57 -0000
@@ -1,19 +1,24 @@
det_errors.m:005: In `p1(in)':
det_errors.m:005: error: determinism declaration not satisfied.
det_errors.m:005: Declared `det', inferred `semidet'.
-det_errors.m:014: In argument 1 of clause head:
-det_errors.m:014: unification of `HeadVar__1' and `42' can fail.
+det_errors.m:018: In argument 1 of clause head:
+det_errors.m:018: unification of `HeadVar__1' and `42' can fail.
det_errors.m:006: In `p2(in)':
det_errors.m:006: error: determinism declaration not satisfied.
det_errors.m:006: Declared `det', inferred `semidet'.
-det_errors.m:015: Unification of `X' and `42' can fail.
+det_errors.m:019: Unification of `X' and `42' can fail.
det_errors.m:007: In `p3(in)':
det_errors.m:007: error: determinism declaration not satisfied.
det_errors.m:007: Declared `det', inferred `semidet'.
-det_errors.m:016: Unification of `X' and `42' can fail.
+det_errors.m:020: Unification of `X' and `42' can fail.
det_errors.m:008: In `p4(in)':
det_errors.m:008: error: determinism declaration not satisfied.
det_errors.m:008: Declared `det', inferred `semidet'.
-det_errors.m:017: In argument 2 of functor `+/2':
-det_errors.m:017: unification with `21' can fail.
+det_errors.m:021: In argument 2 of functor `+/2':
+det_errors.m:021: unification with `21' can fail.
+det_errors.m:013: In `q(in, out)':
+det_errors.m:013: error: determinism declaration not satisfied.
+det_errors.m:013: Declared `det', inferred `semidet'.
+det_errors.m:024: The switch on HeadVar__1 does not cover det_errors.d/0,
+det_errors.m:024: det_errors.e/0, det_errors.f/0 or det_errors.g/0.
For more information, try recompiling with `-E'.
Index: tests/invalid/det_errors.m
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/invalid/det_errors.m,v
retrieving revision 1.2
diff -u -r1.2 det_errors.m
--- tests/invalid/det_errors.m 26 May 2003 09:01:15 -0000 1.2
+++ tests/invalid/det_errors.m 26 Dec 2004 03:18:02 -0000
@@ -8,6 +8,10 @@
:- pred p4(int::in) is det.
:- pred p5(int::in) is det.
+:- type t ---> a ; b ; c ; d ; e ; f ; g.
+
+:- pred q(t::in, int::out) is det.
+
:- implementation.
:- import_module int.
@@ -16,3 +20,7 @@
p3(X) :- X = 42.
p4(X) :- X = 21 + 21.
p5(_) :- true.
+
+q(a, 1).
+q(b, 2).
+q(c, 3).
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list