tuned
authorhaftmann
Mon, 30 Aug 2010 16:21:47 +0200
changeset 39139d1d4d808be26
parent 39138 c79c1e4e1111
child 39140 0a49a34e5d37
tuned
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_haskell.ML	Mon Aug 30 16:17:10 2010 +0200
     1.2 +++ b/src/Tools/Code/code_haskell.ML	Mon Aug 30 16:21:47 2010 +0200
     1.3 @@ -316,7 +316,7 @@
     1.4  fun serialize_haskell module_prefix module_name string_classes labelled_name
     1.5      raw_reserved includes module_alias
     1.6      syntax_class syntax_tyco syntax_const program
     1.7 -    (stmt_names, presentation_stmt_names) width =
     1.8 +    (stmt_names, presentation_stmt_names) =
     1.9    let
    1.10      val reserved = fold (insert (op =) o fst) includes raw_reserved;
    1.11      val (deresolver, hs_program) = haskell_program_of_program labelled_name
    1.12 @@ -396,7 +396,6 @@
    1.13        (fn width => (rpair [] o cat_lines o map (string_of_pretty width o snd)))
    1.14        (map (uncurry print_module) includes
    1.15          @ map serialize_module (Symtab.dest hs_program))
    1.16 -      width
    1.17    end;
    1.18  
    1.19  val literals = let
     2.1 --- a/src/Tools/Code/code_ml.ML	Mon Aug 30 16:17:10 2010 +0200
     2.2 +++ b/src/Tools/Code/code_ml.ML	Mon Aug 30 16:21:47 2010 +0200
     2.3 @@ -908,7 +908,7 @@
     2.4  
     2.5  fun serialize_ml target print_module print_stmt module_name with_signatures labelled_name
     2.6    reserved includes module_alias _ syntax_tyco syntax_const program
     2.7 -  (stmt_names, presentation_stmt_names) width =
     2.8 +  (stmt_names, presentation_stmt_names) =
     2.9    let
    2.10      val is_cons = Code_Thingol.is_cons program;
    2.11      val is_presentation = not (null presentation_stmt_names);
    2.12 @@ -937,7 +937,7 @@
    2.13    in
    2.14      Code_Target.mk_serialization
    2.15        (fn width => (fn NONE => writeln_pretty width | SOME file => File.write file o string_of_pretty width))
    2.16 -      (fn width => (rpair stmt_names' o string_of_pretty width)) p width 
    2.17 +      (fn width => (rpair stmt_names' o string_of_pretty width)) p
    2.18    end;
    2.19  
    2.20  end; (*local*)
     3.1 --- a/src/Tools/Code/code_scala.ML	Mon Aug 30 16:17:10 2010 +0200
     3.2 +++ b/src/Tools/Code/code_scala.ML	Mon Aug 30 16:21:47 2010 +0200
     3.3 @@ -415,7 +415,7 @@
     3.4  
     3.5  fun serialize_scala labelled_name raw_reserved includes module_alias
     3.6      _ syntax_tyco syntax_const
     3.7 -    program (stmt_names, presentation_stmt_names) width =
     3.8 +    program (stmt_names, presentation_stmt_names) =
     3.9    let
    3.10  
    3.11      (* build program *)
    3.12 @@ -483,7 +483,7 @@
    3.13    in
    3.14      Code_Target.mk_serialization
    3.15        (fn width => (fn NONE => writeln_pretty width | SOME file => File.write file o string_of_pretty width))
    3.16 -      (rpair [] oo string_of_pretty) p width
    3.17 +      (rpair [] oo string_of_pretty) p
    3.18    end;
    3.19  
    3.20  end; (*local*)
     4.1 --- a/src/Tools/Code/code_target.ML	Mon Aug 30 16:17:10 2010 +0200
     4.2 +++ b/src/Tools/Code/code_target.ML	Mon Aug 30 16:21:47 2010 +0200
     4.3 @@ -22,7 +22,6 @@
     4.4    type destination
     4.5    type serialization
     4.6    val parse_args: 'a parser -> Token.T list -> 'a
     4.7 -  val stmt_names_of_destination: destination -> string list
     4.8    val mk_serialization: (int -> Path.T option -> 'a -> unit)
     4.9      -> (int -> 'a -> string * string option list)
    4.10      -> 'a -> int -> serialization
    4.11 @@ -67,14 +66,14 @@
    4.12  type serialization = destination -> (string * string option list) option;
    4.13  
    4.14  fun export f = (f (File NONE); ());
    4.15 -fun file p f = (f (File (SOME p)); ());
    4.16 -fun string stmts f = fst (the (f (String stmts)));
    4.17 +fun file path f = (f (File (SOME path)); ());
    4.18 +fun string stmt_names f = fst (the (f (String stmt_names)));
    4.19  
    4.20 -fun stmt_names_of_destination (String stmts) = stmts
    4.21 +fun stmt_names_of_destination (String stmt_names) = stmt_names
    4.22    | stmt_names_of_destination _ = [];
    4.23  
    4.24 -fun mk_serialization output _ code width (File p) = (output width p code; NONE)
    4.25 -  | mk_serialization _ string code width (String _) = SOME (string width code);
    4.26 +fun mk_serialization output _ pretty width (File path) = (output width path pretty; NONE)
    4.27 +  | mk_serialization _ string pretty width (String _) = SOME (string width pretty);
    4.28  
    4.29  
    4.30  (** theory data **)