[m-rev.] diff: fix event set bugs

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Jan 12 16:48:10 AEDT 2007


compiler/layout_out.m:
	Fix two bugs. The first was that a version number was out of sync
	with mercury_stack_layout.h and with reality. The second was that
	we were not printing the null character at the ends of event set
	descriptions.

compiler/prog_event.m:
	Fix a couple of bugs that caused event set descriptions to be
	syntactically invalid: the event set name was missing, and
	two tokens were missing a space between them.

Zoltan.

cvs diff: Diffing .
Index: layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.86
diff -u -b -r1.86 layout_out.m
--- layout_out.m	6 Jan 2007 10:56:14 -0000	1.86
+++ layout_out.m	11 Jan 2007 16:49:57 -0000
@@ -1414,7 +1414,7 @@
     %
 :- func layout_version_number = int.
 
-layout_version_number = 1.
+layout_version_number = 3.
 
 :- pred output_module_layout_data_defn(module_name::in, int::in,
     string_with_0s::in, list(layout_name)::in, list(file_layout_data)::in,
@@ -1729,7 +1729,7 @@
     output_layout_name_storage_type_name(LayoutName, yes, !IO),
     io.write_string(" = {", !IO),
     string.length(EventSetDesc, EventSetDescSize),
-    output_module_string_table_chars_driver(0, EventSetDescSize - 1,
+    output_module_string_table_chars_driver(0, EventSetDescSize,
         string_with_0s(EventSetDesc), !IO),
     io.write_string("};\n", !IO),
     decl_set_insert(decl_data_addr(layout_addr(LayoutName)), !DeclSet).
Index: prog_event.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_event.m,v
retrieving revision 1.7
diff -u -b -r1.7 prog_event.m
--- prog_event.m	22 Dec 2006 05:37:50 -0000	1.7
+++ prog_event.m	12 Jan 2007 04:05:11 -0000
@@ -717,8 +717,9 @@
     EventSet = event_set(EventSetName, EventSpecMap),
     map.values(EventSpecMap, EventSpecList),
     list.sort(compare_event_specs_by_num, EventSpecList, SortedEventSpecList),
-    DescStrings = list.map(describe_event_spec, SortedEventSpecList),
-    string.append_list(DescStrings, Desc),
+    EventDescStrings = list.map(describe_event_spec, SortedEventSpecList),
+    string.append_list(EventDescStrings, EventDescs),
+    Desc = "event set " ++ EventSetName ++ "\n" ++ EventDescs,
     list.foldl(update_max_num_attr, EventSpecList, -1, MaxNumAttr),
     EventSetData = event_set_data(EventSetName, Desc, SortedEventSpecList,
         MaxNumAttr).
@@ -742,7 +743,7 @@
     Spec = event_spec(_EventNumber, EventName, _EventLineNumber,
         Attrs, _SynthAttrNumOrder),
     AttrDescs = string.join_list(",\n", list.map(describe_event_attr, Attrs)),
-    Desc = "event " ++ EventName ++ "(" ++ AttrDescs ++ ")".
+    Desc = "event " ++ EventName ++ "(" ++ AttrDescs ++ ")\n".
 
 :- func describe_event_attr(event_attribute) = string.
 
@@ -757,7 +758,7 @@
         SynthCall = event_attr_synth_call(FuncAttrNameNum, ArgAttrNameNums,
             _Order),
         ArgAttrDesc = string.join_list(", ", assoc_list.keys(ArgAttrNameNums)),
-        SynthCallDesc = "synthesized by " ++
+        SynthCallDesc = " synthesized by " ++
             fst(FuncAttrNameNum) ++ "(" ++ ArgAttrDesc ++ ")"
     ),
     Desc = Name ++ ": " ++ TypeDesc ++ SynthCallDesc.
cvs diff: Diffing notes
--------------------------------------------------------------------------
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