src/Pure/ROOT.ML
changeset 48876 157dd47032e0
parent 48867 e9beabf045ab
child 48879 cb5cdbb645cd
equal deleted inserted replaced
48875:b629f037a0cb 48876:157dd47032e0
   322           (fn () => Thy_Info.toplevel_begin_theory (Thy_Load.get_master_path ()) header)));
   322           (fn () => Thy_Info.toplevel_begin_theory (Thy_Load.get_master_path ()) header)));
   323 
   323 
   324 val _ =
   324 val _ =
   325   Outer_Syntax.command
   325   Outer_Syntax.command
   326     (("ML_file", Keyword.tag_ml Keyword.thy_load), Position.none) "ML text from file"
   326     (("ML_file", Keyword.tag_ml Keyword.thy_load), Position.none) "ML text from file"
   327     (Thy_Load.parse_files "ML_file" >> (fn files => Toplevel.generic_theory (fn gthy =>
   327     (Scan.ahead Parse.path -- Thy_Load.parse_files "ML_file"
   328       let val (_, [(txt, pos)]) = files (Context.theory_of gthy) in
   328       >> (fn (src_path, files) => Toplevel.generic_theory (fn gthy =>
   329         gthy
   329         let
   330         |> ML_Context.exec (fn () => ML_Context.eval_text true pos txt)
   330           val (dir, [(txt, pos)]) = files (Context.theory_of gthy);
   331         |> Local_Theory.propagate_ml_env
   331           val provide = Thy_Load.provide (src_path, (File.full_path dir src_path, SHA1.digest txt));
   332       end)));
   332         in
       
   333           gthy
       
   334           |> ML_Context.exec (fn () => ML_Context.eval_text true pos txt)
       
   335           |> Local_Theory.propagate_ml_env
       
   336           |> Context.mapping provide (Local_Theory.background_theory provide)
       
   337         end)));
   333 
   338 
   334 Unsynchronized.setmp Multithreading.max_threads 1
   339 Unsynchronized.setmp Multithreading.max_threads 1
   335   use_thy "Pure";
   340   use_thy "Pure";
   336 Context.set_thread_data NONE;
   341 Context.set_thread_data NONE;
   337 
   342