avoid name clash of generated modules and includes
authorhaftmann
Mon, 02 Feb 2009 13:56:24 +0100
changeset 29711 64d41ad4ffc2
parent 29710 f2e70a0636b9
child 29712 944657d6932e
child 29782 02e76245e5af
avoid name clash of generated modules and includes
src/Tools/code/code_haskell.ML
--- a/src/Tools/code/code_haskell.ML	Mon Feb 02 13:56:23 2009 +0100
+++ b/src/Tools/code/code_haskell.ML	Mon Feb 02 13:56:24 2009 +0100
@@ -336,11 +336,12 @@
   in (deresolver, hs_program) end;
 
 fun serialize_haskell module_prefix raw_module_name string_classes labelled_name
-    reserved_names includes raw_module_alias
+    raw_reserved_names includes raw_module_alias
     syntax_class syntax_tyco syntax_const naming program cs destination =
   let
     val stmt_names = Code_Target.stmt_names_of_destination destination;
     val module_name = if null stmt_names then raw_module_name else SOME "Code";
+    val reserved_names = fold (insert (op =) o fst) includes raw_reserved_names;
     val (deresolver, hs_program) = haskell_program_of_program labelled_name
       module_name module_prefix reserved_names raw_module_alias program;
     val is_cons = Code_Thingol.is_cons program;