[m-rev.] Trivial diff: test case failure fix.

Ralph Becket rafe at cs.mu.OZ.AU
Mon Oct 11 17:17:45 AEST 2004


Estimated hours taken: 0.2
Branches: main

compiler/mercury_to_mercury.m:
	Add a space after outputting a constructor name with no arguments.
	If we don't do this and the constructor is the last in the type
	definition and the constructor contains graphical characters then
	the following terminating full stop will be wrongly taken to be
	part of the constructor name.  This is an issue with .int files
	and causes tests/hard_coded/quoting_bug_test.m to fail.

Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.247
diff -u -r1.247 mercury_to_mercury.m
--- mercury_to_mercury.m	5 Sep 2004 23:52:19 -0000	1.247
+++ mercury_to_mercury.m	11 Oct 2004 07:08:36 -0000
@@ -1794,7 +1794,11 @@
 		mercury_output_remaining_ctor_args(VarSet, Rest),
 		io__write_string(")")
 	;
-		mercury_output_bracketed_sym_name(unqualified(Name))
+		mercury_output_bracketed_sym_name(unqualified(Name)),
+			% This space prevents a terminating full stop
+			% from being confused as part of the sym_name if
+			% the sym_name contains graphical characters.
+		io__write_string(" ")
 	),
 	(
 		{ Arity = 2 },
--------------------------------------------------------------------------
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