[m-dev.] diff: relax file_name <-> module_name mapping

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 29 18:49:26 AEST 1998


On 28-May-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 
> Allow modules to be put in source files whose names that do not directly match
> their the module names.  When looking for the source for a module such
> as `foo:bar:baz', search for it first in `foo.bar.baz.m', then in `bar.baz.m',
> and finally in `baz.m'.

Since the compiler now uses the module name in the source file rather
than the name of the source file to determine the name of many of
the files it generates, it is now a bit pickier about how you name
modules.  For example, having two files in the same directory
with the same module name in their `:- module' declarations doesn't
work anymore.  Hence the following additional change:

tests/*/*.m:
tests/*/*.exp:
	Fix a few incorrect module names in `:- module' declarations.

cvs diff: Diffing .
cvs diff: Diffing benchmarks
cvs diff: Diffing debugger
Index: debugger/debugger_regs_lib.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/debugger_regs_lib.m,v
retrieving revision 1.1
diff -u -u -r1.1 debugger_regs_lib.m
--- debugger_regs_lib.m	1998/05/16 07:31:11	1.1
+++ debugger_regs_lib.m	1998/05/28 14:17:50
@@ -3,7 +3,7 @@
 % At the moment, MAX_REAL_REGS is 32, so a procedure with 41 args
 % is a full test.
 
-:- module debugger_regs.
+:- module debugger_regs_lib.
 
 :- interface.
 
Index: debugger/interpreter_lib.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/interpreter_lib.m,v
retrieving revision 1.1
diff -u -u -r1.1 interpreter_lib.m
--- interpreter_lib.m	1998/05/16 07:31:22	1.1
+++ interpreter_lib.m	1998/05/29 04:42:32
@@ -1,6 +1,6 @@
 %-----------------------------------------------------------------------------%
 
-% File: interpreter.m.
+% File: interpreter_lib.m.
 % Main author: fjh.
 
 % This is an interpreter for definite logic programs
@@ -19,7 +19,7 @@
 
 %-----------------------------------------------------------------------------%
 
-:- module interpreter.
+:- module interpreter_lib.
 :- interface.
 :- import_module io.
 
Index: debugger/queens_lib.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/queens_lib.m,v
retrieving revision 1.1
diff -u -u -r1.1 queens_lib.m
--- queens_lib.m	1998/05/16 07:31:30	1.1
+++ queens_lib.m	1998/05/28 14:18:02
@@ -1,4 +1,4 @@
-:- module queens.
+:- module queens_lib.
 
 :- interface.
 
cvs diff: Diffing general
Index: general/nondet_ite_3.m
===================================================================
RCS file: /home/mercury1/repository/tests/general/nondet_ite_3.m,v
retrieving revision 1.1
diff -u -u -r1.1 nondet_ite_3.m
--- nondet_ite_3.m	1997/01/08 07:55:54	1.1
+++ nondet_ite_3.m	1998/05/28 14:27:14
@@ -1,6 +1,6 @@
 % nondet_ite_3.m: test nondet if-then-else with semidet condition.
 
-:- module nondet_ite.
+:- module nondet_ite_3.
 :- interface.
 :- import_module io.
 
cvs diff: Diffing hard_coded
Index: hard_coded/boyer.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/boyer.m,v
retrieving revision 1.1
diff -u -u -r1.1 boyer.m
--- boyer.m	1997/06/10 04:03:56	1.1
+++ boyer.m	1998/05/29 04:45:34
@@ -13,7 +13,7 @@
 
 %	in Mercury by Bart Demoen - started 17 Jan 1997
 
-:- module boy_notypes .
+:- module boyer .
 
 :- interface.
 :- import_module io, int.
cvs diff: Diffing hard_coded/typeclasses
cvs diff: Diffing invalid
Index: invalid/prog_io_erroneous.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/prog_io_erroneous.err_exp,v
retrieving revision 1.2
diff -u -u -r1.2 prog_io_erroneous.err_exp
--- prog_io_erroneous.err_exp	1998/03/03 17:47:59	1.2
+++ prog_io_erroneous.err_exp	1998/05/29 08:01:07
@@ -1,4 +1,3 @@
-prog_io_erroneous.m:001: Warning: incorrect module name in `:- module' declaration: :- module p.
 prog_io_erroneous.m:012: Error: no clauses for predicate `prog_io_erroneous:q/2'
 prog_io_erroneous.m:007: In clause for `p(in, out, out)':
 prog_io_erroneous.m:007:   in argument 1 of call to predicate `prog_io_erroneous:q/2':
Index: invalid/prog_io_erroneous.m
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/prog_io_erroneous.m,v
retrieving revision 1.1
diff -u -u -r1.1 prog_io_erroneous.m
--- prog_io_erroneous.m	1995/07/11 13:12:06	1.1
+++ prog_io_erroneous.m	1998/05/29 07:24:43
@@ -1,4 +1,4 @@
-:- module p.
+:- module prog_io_erroneous.
 
 :- pred p(int, int, int).
 :- mode p(in, out, out).
Index: invalid/typeclass_test_2.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/typeclass_test_2.err_exp,v
retrieving revision 1.5
diff -u -u -r1.5 typeclass_test_2.err_exp
--- typeclass_test_2.err_exp	1998/05/18 08:54:47	1.5
+++ typeclass_test_2.err_exp	1998/05/29 08:26:43
@@ -1,4 +1,3 @@
-typeclass_test_2.m:001: Warning: incorrect module name in `:- module' declaration: :- module foo.
 typeclass_test_2.m:020: Error: expected `pred(<Name> / <Arity>) is <InstanceName>': type_num / 0 is foo_type_num.
 typeclass_test_2.m:023: Error: clause for function `typeclass_test_2:foo_type_num/1'
 typeclass_test_2.m:023:   without preceding `func' declaration.
Index: invalid/typeclass_test_2.m
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/typeclass_test_2.m,v
retrieving revision 1.2
diff -u -u -r1.2 typeclass_test_2.m
--- typeclass_test_2.m	1998/05/18 08:54:49	1.2
+++ typeclass_test_2.m	1998/05/29 08:26:08
@@ -1,4 +1,4 @@
-:- module foo.
+:- module typeclass_test_2.
 :- interface.
 :- import_module io.
 :- pred main(io__state::di, io__state::uo) is det.
Index: invalid/types.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/types.err_exp,v
retrieving revision 1.3
diff -u -u -r1.3 types.err_exp
--- types.err_exp	1998/03/03 17:48:04	1.3
+++ types.err_exp	1998/05/29 08:01:09
@@ -1,4 +1,3 @@
-types.m:001: Warning: incorrect module name in `:- module' declaration: :- module t.
 types.m:003: Error: constructor `types:a/0' for type `types:t/0' multiply defined.
 types.m:003: Error: constructor `types:f/1' for type `types:t/0' multiply defined.
 types.m:017: Error: clause for predicate `types:r/0'
Index: invalid/types.m
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/types.m,v
retrieving revision 1.1
diff -u -u -r1.1 types.m
--- types.m	1995/07/11 13:12:08	1.1
+++ types.m	1998/05/28 14:39:34
@@ -1,4 +1,4 @@
-:- module t.
+:- module types.
 
 :- type t ---> a; a; f(t); f(t).
 
Index: invalid/undef_type.err_exp
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/undef_type.err_exp,v
retrieving revision 1.2
diff -u -u -r1.2 undef_type.err_exp
--- undef_type.err_exp	1998/03/03 17:48:06	1.2
+++ undef_type.err_exp	1998/05/29 08:01:11
@@ -1,4 +1,3 @@
-undef_type.m:001: Warning: incorrect module name in `:- module' declaration: :- module test1.
 undef_type.m:003: In definition of type `undef_type:t1'/0:
 undef_type.m:003:   error: undefined type `undef1'/0.
 undef_type.m:010: In definition of predicate `undef_type:q'/1:
Index: invalid/undef_type.m
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/undef_type.m,v
retrieving revision 1.1
diff -u -u -r1.1 undef_type.m
--- undef_type.m	1995/07/11 13:12:09	1.1
+++ undef_type.m	1998/05/29 07:25:27
@@ -1,4 +1,4 @@
-:- module test1.
+:- module undef_type.
 
 :- type t1 ---> a ; b ; c ; d(undef1).
 
cvs diff: Diffing misc_tests
cvs diff: Diffing term
Index: term/my_list.m
===================================================================
RCS file: /home/mercury1/repository/tests/term/my_list.m,v
retrieving revision 1.1
diff -u -u -r1.1 my_list.m
--- my_list.m	1998/02/12 11:48:57	1.1
+++ my_list.m	1998/05/28 14:37:30
@@ -1,4 +1,4 @@
-:- module list.
+:- module my_list.
 
 :- interface.
 
Index: term/my_map.m
===================================================================
RCS file: /home/mercury1/repository/tests/term/my_map.m,v
retrieving revision 1.1
diff -u -u -r1.1 my_map.m
--- my_map.m	1998/02/12 11:48:58	1.1
+++ my_map.m	1998/05/28 14:37:23
@@ -1,4 +1,4 @@
-:- module map.
+:- module my_map.
 
 :- interface.
 
cvs diff: Diffing valid
Index: valid/explicit_quant.m
===================================================================
RCS file: /home/mercury1/repository/tests/valid/explicit_quant.m,v
retrieving revision 1.1
diff -u -u -r1.1 explicit_quant.m
--- explicit_quant.m	1998/01/22 07:29:47	1.1
+++ explicit_quant.m	1998/05/28 14:36:37
@@ -1,4 +1,4 @@
-:- module explict_quant.
+:- module explicit_quant.
 
 :- interface.
 :- import_module list, char.
cvs diff: Diffing warnings

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list