[m-rev.] diff: fix quoting in imdg files

Peter Wang novalazy at gmail.com
Fri Aug 29 10:50:14 AEST 2008


Branches: main

Modules names beginning with capital letters were not being quoted in
`.imdg' files, so they could not be read back in properly.

compiler/analysis.file.m:
	Call `write_quoted_sym_name' instead of `write_sym_name'.

compiler/prog_out.m:
	Describe `write_quoted_sym_name' more accurately in its comment.

diff --git a/compiler/analysis.file.m b/compiler/analysis.file.m
index 98009ff..5768d30 100644
--- a/compiler/analysis.file.m
+++ b/compiler/analysis.file.m
@@ -834,7 +834,7 @@ write_func_id(func_id(PredOrFunc, Name, Arity, ProcId), !IO) :-
 :- pred write_module_name(module_name::in, io::di, io::uo) is det.
 
 write_module_name(ModuleName, !IO) :-
-    write_sym_name(ModuleName, !IO).
+    write_quoted_sym_name(ModuleName, !IO).
 
 %-----------------------------------------------------------------------------%
 
diff --git a/compiler/prog_out.m b/compiler/prog_out.m
index 4a43246..9c2a3ef 100644
--- a/compiler/prog_out.m
+++ b/compiler/prog_out.m
@@ -50,8 +50,8 @@
 :- pred write_sym_name_and_arity(sym_name_and_arity::in, io::di, io::uo)
     is det.
 
-    % Write out a symbol name, enclosed in single forward quotes ('...')
-    % if necessary, and with any special characters escaped.
+    % Write out a symbol name, enclosed in single forward quotes ('...'),
+    % and with any special characters escaped.
     % The output should be a syntactically valid Mercury term.
     %
 :- pred write_quoted_sym_name(sym_name::in, io::di, io::uo) is det.



--------------------------------------------------------------------------
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