src/Pure/System/session.ML
changeset 50121 97d2b77313a0
parent 49931 85780e6f8fd2
child 50430 702278df3b57
equal deleted inserted replaced
50120:245f5947233c 50121:97d2b77313a0
     9   val id: unit -> string list
     9   val id: unit -> string list
    10   val name: unit -> string
    10   val name: unit -> string
    11   val welcome: unit -> string
    11   val welcome: unit -> string
    12   val finish: unit -> unit
    12   val finish: unit -> unit
    13   val init: bool -> bool -> bool -> string -> string -> bool -> string -> (string * string) list ->
    13   val init: bool -> bool -> bool -> string -> string -> bool -> string -> (string * string) list ->
    14     string -> string -> string * Present.dump_mode -> string -> bool -> unit
    14     string -> string -> bool * string -> string -> bool -> unit
    15   val with_timing: string -> bool -> ('a -> 'b) -> 'a -> 'b
    15   val with_timing: string -> bool -> ('a -> 'b) -> 'a -> 'b
    16   val use_dir: string -> string -> bool -> string list -> bool -> bool -> string ->
    16   val use_dir: string -> string -> bool -> string list -> bool -> bool -> string ->
    17     string -> bool -> string list -> string -> string -> bool * string ->
    17     string -> bool -> string list -> string -> string -> bool * string ->
    18     string -> int -> bool -> bool -> int -> int -> int -> int -> unit
    18     string -> int -> bool -> bool -> int -> int -> int -> int -> unit
    19 end;
    19 end;
   113     doc_variants (path ()) name doc_dump (get_rpath rpath) verbose
   113     doc_variants (path ()) name doc_dump (get_rpath rpath) verbose
   114     (map Thy_Info.get_theory (Thy_Info.get_names ())));
   114     (map Thy_Info.get_theory (Thy_Info.get_names ())));
   115 
   115 
   116 local
   116 local
   117 
   117 
   118 fun doc_dump (cp, dump) = (dump, if cp then Present.Dump_all else Present.Dump_tex_sty);
       
   119 
       
   120 fun read_variants strs =
   118 fun read_variants strs =
   121   rev (distinct (eq_fst (op =)) (rev (("document", "") :: map Present.read_variant strs)))
   119   rev (distinct (eq_fst (op =)) (rev (("document", "") :: map Present.read_variant strs)))
   122   |> filter_out (fn (_, s) => s = "-");
   120   |> filter_out (fn (_, s) => s = "-");
   123 
   121 
   124 in
   122 in
   125 
   123 
   126 fun use_dir item root build modes reset info info_path doc doc_graph doc_variants parent
   124 fun use_dir item root build modes reset info info_path doc doc_graph doc_variants parent
   127     name dump rpath level timing verbose max_threads trace_threads
   125     name doc_dump rpath level timing verbose max_threads trace_threads
   128     parallel_proofs parallel_proofs_threshold =
   126     parallel_proofs parallel_proofs_threshold =
   129   ((fn () =>
   127   ((fn () =>
   130     let
   128     let
   131       val _ =
   129       val _ =
   132         Output.physical_stderr
   130         Output.physical_stderr
   133           "### Legacy feature: old \"isabelle usedir\" -- use \"isabelle build\" instead!\n";
   131           "### Legacy feature: old \"isabelle usedir\" -- use \"isabelle build\" instead!\n";
   134       val _ =
   132       val _ =
   135         init build reset info info_path doc doc_graph "" (read_variants doc_variants) parent name
   133         init build reset info info_path doc doc_graph "" (read_variants doc_variants) parent name
   136           (doc_dump dump) rpath verbose;
   134           doc_dump rpath verbose;
   137       val res1 = (use |> with_timing item timing |> Exn.capture) root;
   135       val res1 = (use |> with_timing item timing |> Exn.capture) root;
   138       val res2 = Exn.capture finish ();
   136       val res2 = Exn.capture finish ();
   139     in ignore (Par_Exn.release_all [res1, res2]) end)
   137     in ignore (Par_Exn.release_all [res1, res2]) end)
   140     |> Unsynchronized.setmp Proofterm.proofs level
   138     |> Unsynchronized.setmp Proofterm.proofs level
   141     |> Unsynchronized.setmp print_mode (modes @ print_mode_value ())
   139     |> Unsynchronized.setmp print_mode (modes @ print_mode_value ())