Files
mercury/tests/hard_coded/dot_separator.m
Ralph Becket a8ffd3680c Change the compiler and tools so that .' and not :' is now used as the
Estimated hours taken: 14
Branches: main

Change the compiler and tools so that `.' and not `:' is now used as the
module separator in all output.

Infix `.' now has associativity yfx and priority 10.

NEWS:
	Report the change.

configure.in:
	Amend the test for an up-to-date Mercury compiler to check whether
	it recognises `.' as a module qualifier.

compiler/code_gen.m:
compiler/error_util.m:
compiler/hlds_out.m:
compiler/prog_out.m:
compiler/prog_util.m:
compiler/rl_exprn.m:
compiler/rl_gen.m:
compiler/source_file_map.m:
compiler/unused_args.m:
library/io.m:
library/rtti_implementation.m:
library/type_desc.m:
runtime/mercury_debug.c:
runtime/mercury_deconstruct.c:
runtime/mercury_stack_trace.c:
	Change `:' to `.' as module separator for output.

compiler/mercury_to_mercury.m:
compiler/prog_io_typeclass.m:
	As above.
	Fixed a bug where `.' was not being recognised as a module separator.

doc/reference_manual.texi:
	Report the change.

library/term_io.m:
	Ensure that infix `.' is written without surrounding spaces.

tests/hard_coded/dot_separator.m:
tests/hard_coded/dot_separator.exp:
tests/hard_coded/Mmakefile:
	Test case added.
2003-01-17 05:57:20 +00:00

69 lines
1.4 KiB
Mathematica

%-----------------------------------------------------------------------------%
% dot_separator.m
% Ralph Becket <rafe@cs.mu.oz.au>
% Fri Jan 17 14:10:30 EST 2003
% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
%
% This tests that the compiler correctly quotes '.' where necessary
% as a module separator in the output files.
%
%-----------------------------------------------------------------------------%
:- module dot_separator.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- module foo_1.
:- interface.
:- type foo_1.bar ---> bar.
:- type foo_1.'234' ---> foo_1.'234'.
:- type foo_1.'345bar' ---> '345bar'.
:- type foo_1.'.bar' ---> '.bar'.
:- end_module foo_1.
% The submodules below are commented out because the compiler tools
% really don't like symbols that contain `.'s.
% :- module 'foo.'.
% :- interface.
%
% :- type 'foo.'.baz ---> baz.
% :- type 'foo.'.'234' ---> 'foo.'.'234'.
% :- type 'foo.'.'345baz' ---> '345baz'.
% :- type 'foo.'.'.baz' ---> '.baz'.
%
% :- end_module 'foo.'.
% :- module ('.').
% :- interface.
%
% :- type ('.').quux ---> quux.
% :- type ('.').'456' ---> '456'.
% :- type ('.').'567quux' ---> '567quux'.
% :- type ('.').'.quux' ---> '.quux'.
%
% :- end_module ('.').
:- implementation.
main(!IO) :-
io__write_string("All's well that ends well.\n", !IO).