src/Tools/Code/code_target.ML
changeset 59430 b65809f05dc9
parent 59324 f5f9993a168d
child 59479 b36379a730f4
equal deleted inserted replaced
59429:f24ac9df7ab2 59430:b65809f05dc9
   148       (output width some_path content; NONE)
   148       (output width some_path content; NONE)
   149   | serialization _ string content width Produce =
   149   | serialization _ string content width Produce =
   150       string [] width content |> SOME
   150       string [] width content |> SOME
   151   | serialization _ string content width (Present syms) =
   151   | serialization _ string content width (Present syms) =
   152      string syms width content
   152      string syms width content
   153      |> (apfst o map o apsnd) (Pretty.output (SOME width) o Pretty.str)
   153      |> (apfst o map o apsnd) Output.output
   154      |> SOME;
   154      |> SOME;
   155 
   155 
   156 fun export some_path f = (f (Export some_path); ());
   156 fun export some_path f = (f (Export some_path); ());
   157 fun produce f = the (f Produce);
   157 fun produce f = the (f Produce);
   158 fun present syms f = space_implode "\n\n" (map snd (fst (the (f (Present syms)))));
   158 fun present syms f = space_implode "\n\n" (map snd (fst (the (f (Present syms)))));
   569   in
   569   in
   570     Code_Symbol.maps_attr'
   570     Code_Symbol.maps_attr'
   571       (arrange check_const_syntax) (arrange check_tyco_syntax)
   571       (arrange check_const_syntax) (arrange check_tyco_syntax)
   572         (arrange ((K o K o K) I)) (arrange ((K o K o K) I)) (arrange ((K o K o K) I))
   572         (arrange ((K o K o K) I)) (arrange ((K o K o K) I)) (arrange ((K o K o K) I))
   573         (arrange (fn ctxt => fn _ => fn _ => fn (raw_content, raw_cs) =>
   573         (arrange (fn ctxt => fn _ => fn _ => fn (raw_content, raw_cs) =>
   574           (Code_Printer.str raw_content, map (prep_const ctxt) raw_cs)))
   574           (Pretty.blk (0, Pretty.fbreaks (map Code_Printer.str (split_lines raw_content))),
       
   575             map (prep_const ctxt) raw_cs)))
   575   end;
   576   end;
   576 
   577 
   577 fun cert_printings ctxt = cert_syms ctxt #> arrange_printings cert_const ctxt;
   578 fun cert_printings ctxt = cert_syms ctxt #> arrange_printings cert_const ctxt;
   578 
   579 
   579 fun read_printings ctxt = read_syms ctxt #> arrange_printings read_const ctxt;
   580 fun read_printings ctxt = read_syms ctxt #> arrange_printings read_const ctxt;