src/Pure/Isar/isar.ML
changeset 26643 99f5407c05ef
parent 26606 379596d12f25
child 27428 f92d47cdc0de
equal deleted inserted replaced
26642:454d11701fa4 26643:99f5407c05ef
    13   val goal: unit -> thm
    13   val goal: unit -> thm
    14   val >> : Toplevel.transition -> bool
    14   val >> : Toplevel.transition -> bool
    15   val >>> : Toplevel.transition list -> unit
    15   val >>> : Toplevel.transition list -> unit
    16   val init: unit -> unit
    16   val init: unit -> unit
    17   val crashes: exn list ref
    17   val crashes: exn list ref
    18   val toplevel_loop: {init: bool, sync: bool, secure: bool} -> unit
    18   val toplevel_loop: {init: bool, welcome: bool, sync: bool, secure: bool} -> unit
    19   val loop: unit -> unit
    19   val loop: unit -> unit
    20   val main: unit -> unit
    20   val main: unit -> unit
    21 end;
    21 end;
    22 
    22 
    23 structure Isar: ISAR =
    23 structure Isar: ISAR =
    79       raw_loop secure src)
    79       raw_loop secure src)
    80   end;
    80   end;
    81 
    81 
    82 in
    82 in
    83 
    83 
    84 fun toplevel_loop {init = do_init, sync, secure} =
    84 fun toplevel_loop {init = do_init, welcome, sync, secure} =
    85  (Context.set_thread_data NONE;
    85  (Context.set_thread_data NONE;
    86   if do_init then (init (); writeln (Session.welcome ())) else ();
    86   if do_init then init () else ();
       
    87   if welcome then writeln (Session.welcome ()) else ();
    87   uninterruptible (fn _ => fn () => raw_loop secure (OuterSyntax.isar sync)) ());
    88   uninterruptible (fn _ => fn () => raw_loop secure (OuterSyntax.isar sync)) ());
    88 
    89 
    89 end;
    90 end;
    90 
    91 
    91 fun loop () = toplevel_loop {init = false, sync = false, secure = Secure.is_secure ()};
    92 fun loop () =
    92 fun main () = toplevel_loop {init = true, sync = false, secure = Secure.is_secure ()};
    93   toplevel_loop {init = false, welcome = false, sync = false, secure = Secure.is_secure ()};
       
    94 fun main () =
       
    95   toplevel_loop {init = true, welcome = true, sync = false, secure = Secure.is_secure ()};
    93 
    96 
    94 end;
    97 end;
    95 
    98