src/Tools/Code/code_ml.ML
changeset 39056 fa197571676b
parent 39034 ebeb48fd653b
child 39057 c6d146ed07ae
     1.1 --- a/src/Tools/Code/code_ml.ML	Thu Sep 02 13:43:38 2010 +0200
     1.2 +++ b/src/Tools/Code/code_ml.ML	Thu Sep 02 13:58:16 2010 +0200
     1.3 @@ -793,14 +793,15 @@
     1.4      val is_presentation = not (null presentation_names);
     1.5      val { deresolver, hierarchical_program = ml_program } =
     1.6        ml_program_of_program labelled_name (Name.make_context reserved_syms) module_alias program;
     1.7 +    val print_stmt = print_stmt labelled_name tyco_syntax const_syntax
     1.8 +      (make_vars reserved_syms) is_cons;
     1.9      fun print_node _ (_, Code_Namespace.Dummy) =
    1.10            NONE
    1.11 -      | print_node prefix_fragments (_, Code_Namespace.Stmt stmt) =
    1.12 +      | print_node prefix_fragments (name, Code_Namespace.Stmt stmt) =
    1.13            if is_presentation andalso
    1.14              (null o filter (member (op =) presentation_names) o stmt_names_of) stmt
    1.15            then NONE
    1.16 -          else SOME (print_stmt labelled_name tyco_syntax const_syntax (make_vars reserved_syms)
    1.17 -            is_cons (deresolver prefix_fragments) stmt)
    1.18 +          else SOME (apsnd (markup_stmt name) (print_stmt (deresolver prefix_fragments) stmt))
    1.19        | print_node prefix_fragments (name_fragment, Code_Namespace.Module (_, nodes)) =
    1.20            let
    1.21              val (decls, body) = print_nodes (prefix_fragments @ [name_fragment]) nodes;
    1.22 @@ -815,8 +816,8 @@
    1.23        |> (fn (decls, body) => (flat decls, body))
    1.24      val names' = map (try (deresolver [])) names;
    1.25      val p = Pretty.chunks2 (map snd includes @ snd (print_nodes [] ml_program));
    1.26 -    fun write width NONE = writeln o format false width
    1.27 -      | write width (SOME p) = File.write p o format false width;
    1.28 +    fun write width NONE = writeln o format [] width
    1.29 +      | write width (SOME p) = File.write p o format [] width;
    1.30    in
    1.31      Code_Target.serialization write (rpair names' ooo format) p
    1.32    end;