dropped single_module parameter
authorhaftmann
Tue Aug 31 15:08:04 2010 +0200 (2010-08-31)
changeset 389280e6f54c9d201
parent 38927 544f4702d621
child 38929 d9ac9dee764d
dropped single_module parameter
src/Tools/Code/code_eval.ML
src/Tools/Code/code_haskell.ML
src/Tools/Code/code_ml.ML
src/Tools/Code/code_scala.ML
src/Tools/Code/code_target.ML
     1.1 --- a/src/Tools/Code/code_eval.ML	Tue Aug 31 14:43:27 2010 +0200
     1.2 +++ b/src/Tools/Code/code_eval.ML	Tue Aug 31 15:08:04 2010 +0200
     1.3 @@ -59,7 +59,7 @@
     1.4            |> fold (curry Graph.add_edge value_name) deps;
     1.5          val (value_code, [SOME value_name']) = Code_Target.produce_code_for thy
     1.6            (the_default target some_target) NONE (SOME "") [] naming program ([value_name], []);
     1.7 -        val sml_code = "let\n" ^ value_code ^ "\nin " ^ value_name'
     1.8 +        val sml_code = "let\n" ^ value_code ^ "\nin " ^ Long_Name.base_name value_name'
     1.9            ^ space_implode " " (map (enclose "(" ")") args) ^ " end";
    1.10        in ML_Context.evaluate ctxt false reff sml_code end;
    1.11    in Code_Thingol.dynamic_eval_value thy postproc evaluator t end;
     2.1 --- a/src/Tools/Code/code_haskell.ML	Tue Aug 31 14:43:27 2010 +0200
     2.2 +++ b/src/Tools/Code/code_haskell.ML	Tue Aug 31 15:08:04 2010 +0200
     2.3 @@ -314,7 +314,7 @@
     2.4    in (deresolver, hs_program) end;
     2.5  
     2.6  fun serialize_haskell module_prefix string_classes { labelled_name,
     2.7 -    reserved_syms, includes, single_module, module_alias,
     2.8 +    reserved_syms, includes, module_alias,
     2.9      class_syntax, tyco_syntax, const_syntax, program,
    2.10      names, presentation_names } =
    2.11    let
    2.12 @@ -350,7 +350,7 @@
    2.13      fun serialize_module1 (module_name', (deps, (stmts, _))) =
    2.14        let
    2.15          val stmt_names = map fst stmts;
    2.16 -        val qualified = not single_module;
    2.17 +        val qualified = null presentation_names;
    2.18          val imports = subtract (op =) stmt_names deps
    2.19            |> distinct (op =)
    2.20            |> map_filter (try deresolver)
     3.1 --- a/src/Tools/Code/code_ml.ML	Tue Aug 31 14:43:27 2010 +0200
     3.2 +++ b/src/Tools/Code/code_ml.ML	Tue Aug 31 15:08:04 2010 +0200
     3.3 @@ -903,7 +903,7 @@
     3.4    in (deresolver, nodes) end;
     3.5  
     3.6  fun serialize_ml target print_module print_stmt with_signatures { labelled_name,
     3.7 -  reserved_syms, includes, single_module, module_alias, class_syntax, tyco_syntax,
     3.8 +  reserved_syms, includes, module_alias, class_syntax, tyco_syntax,
     3.9    const_syntax, program, names, presentation_names } =
    3.10    let
    3.11      val is_cons = Code_Thingol.is_cons program;
    3.12 @@ -927,8 +927,7 @@
    3.13          o rev o flat o Graph.strong_conn) nodes
    3.14        |> split_list
    3.15        |> (fn (decls, body) => (flat decls, body))
    3.16 -    val names' = map (try (deresolver [])) names
    3.17 -      |> single_module ? (map o Option.map) Long_Name.base_name;
    3.18 +    val names' = map (try (deresolver [])) names;
    3.19      val p = Pretty.chunks2 (map snd includes @ snd (print_nodes [] nodes));
    3.20      fun write width NONE = writeln_pretty width
    3.21        | write width (SOME p) = File.write p o string_of_pretty width;
     4.1 --- a/src/Tools/Code/code_scala.ML	Tue Aug 31 14:43:27 2010 +0200
     4.2 +++ b/src/Tools/Code/code_scala.ML	Tue Aug 31 15:08:04 2010 +0200
     4.3 @@ -413,7 +413,7 @@
     4.4  
     4.5    in (deresolver, sca_program) end;
     4.6  
     4.7 -fun serialize_scala { labelled_name, reserved_syms, includes, single_module,
     4.8 +fun serialize_scala { labelled_name, reserved_syms, includes,
     4.9      module_alias, class_syntax, tyco_syntax, const_syntax, program,
    4.10      names, presentation_names } =
    4.11    let
     5.1 --- a/src/Tools/Code/code_target.ML	Tue Aug 31 14:43:27 2010 +0200
     5.2 +++ b/src/Tools/Code/code_target.ML	Tue Aug 31 15:08:04 2010 +0200
     5.3 @@ -105,7 +105,6 @@
     5.4      labelled_name: string -> string,
     5.5      reserved_syms: string list,
     5.6      includes: (string * Pretty.T) list,
     5.7 -    single_module: bool,
     5.8      module_alias: string -> string option,
     5.9      class_syntax: string -> string option,
    5.10      tyco_syntax: string -> Code_Printer.tyco_syntax option,
    5.11 @@ -314,7 +313,6 @@
    5.12        labelled_name = Code_Thingol.labelled_name thy proto_program,
    5.13        reserved_syms = reserved,
    5.14        includes = includes,
    5.15 -      single_module = is_some module_name,
    5.16        module_alias = if is_some module_name then K module_name else Symtab.lookup module_alias,
    5.17        class_syntax = Symtab.lookup class_syntax,
    5.18        tyco_syntax = Symtab.lookup tyco_syntax,