src/Pure/ROOT.ML
changeset 62493 dd154240a53c
parent 62490 39d01eaf5292
child 62494 b90109b2487c
equal deleted inserted replaced
62492:0e53fade87fe 62493:dd154240a53c
     1 (*** Isabelle/Pure bootstrap from "RAW" environment ***)
     1 (*** Isabelle/Pure bootstrap from "RAW" environment ***)
     2 
     2 
     3 (** bootstrap phase 0: towards secure ML barrier *)
     3 (** bootstrap phase 0: towards ML within position context *)
     4 
     4 
     5 structure Distribution =     (*filled-in by makedist*)
     5 structure Distribution =     (*filled-in by makedist*)
     6 struct
     6 struct
     7   val version = "unidentified repository version";
     7   val version = "unidentified repository version";
     8   val is_identified = false;
     8   val is_identified = false;
    31 use "General/position.ML";
    31 use "General/position.ML";
    32 use "General/symbol_pos.ML";
    32 use "General/symbol_pos.ML";
    33 use "General/input.ML";
    33 use "General/input.ML";
    34 use "General/antiquote.ML";
    34 use "General/antiquote.ML";
    35 use "ML/ml_lex.ML";
    35 use "ML/ml_lex.ML";
    36 use "ML/ml_parse.ML";
    36 
    37 use "General/secure.ML";
    37 val {use, use_debug, use_no_debug} =
    38 
    38   let
    39 val use_text = Secure.use_text;
    39     val global_context: use_context =
    40 val use_file = Secure.use_file;
    40      {name_space = ML_Name_Space.global,
    41 
    41       here = Position.here oo Position.line_file,
    42 local
    42       print = writeln,
    43   fun use_ opt_debug file =
    43       error = error}
    44     Position.setmp_thread_data (Position.file_only file)
    44   in
    45       (fn () =>
    45     use_operations (fn opt_debug => fn file =>
    46         Secure.use_file ML_Parse.global_context
    46       Position.setmp_thread_data (Position.file_only file)
    47           {verbose = true, debug = use_debug_option opt_debug} file
    47         (fn () =>
    48         handle ERROR msg => (writeln msg; error "ML error")) ();
    48           use_file global_context {verbose = true, debug = use_debug_option opt_debug} file
    49 in
    49             handle ERROR msg => (writeln msg; error "ML error")) ())
    50   val use = use_ NONE;
    50   end;
    51   val use_debug = use_ (SOME true);
       
    52   val use_no_debug = use_ (SOME false);
       
    53 end;
       
    54 
    51 
    55 
    52 
    56 
    53 
    57 (** bootstrap phase 1: towards ML within Isar context *)
    54 (** bootstrap phase 1: towards ML within Isar context *)
    58 
    55 
   228 
   225 
   229 (*ML with context and antiquotations*)
   226 (*ML with context and antiquotations*)
   230 use "ML/ml_context.ML";
   227 use "ML/ml_context.ML";
   231 use "ML/ml_antiquotation.ML";
   228 use "ML/ml_antiquotation.ML";
   232 
   229 
   233 local
   230 val {use, use_debug, use_no_debug} =
   234   fun use_ opt_debug file =
   231   use_operations (fn opt_debug => fn file =>
   235     let val flags = ML_Compiler.debug_flags opt_debug |> ML_Compiler.verbose true in
   232     let val flags = ML_Compiler.verbose true (ML_Compiler.debug_flags opt_debug) in
   236       ML_Context.eval_file flags (Path.explode file)
   233       ML_Context.eval_file flags (Path.explode file)
   237         handle ERROR msg => (writeln msg; error "ML error")
   234         handle ERROR msg => (writeln msg; error "ML error")
   238     end;
   235     end);
   239 in
       
   240 
       
   241 val use = use_ NONE;
       
   242 val use_debug = use_ (SOME true);
       
   243 val use_no_debug = use_ (SOME false);
       
   244 
       
   245 end;
       
   246 
   236 
   247 
   237 
   248 
   238 
   249 (** bootstrap phase 2: towards Pure.thy and final ML toplevel setup *)
   239 (** bootstrap phase 2: towards Pure.thy and final ML toplevel setup *)
   250 
   240