16 val linear_undo: int -> unit |
16 val linear_undo: int -> unit |
17 val undo: int -> unit |
17 val undo: int -> unit |
18 val kill: unit -> unit |
18 val kill: unit -> unit |
19 val kill_proof: unit -> unit |
19 val kill_proof: unit -> unit |
20 val crashes: exn list Unsynchronized.ref |
20 val crashes: exn list Unsynchronized.ref |
21 val toplevel_loop: {init: bool, welcome: bool, sync: bool, secure: bool} -> unit |
21 val toplevel_loop: TextIO.instream -> |
|
22 {init: bool, welcome: bool, sync: bool, secure: bool} -> unit |
22 val loop: unit -> unit |
23 val loop: unit -> unit |
23 val main: unit -> unit |
24 val main: unit -> unit |
24 end; |
25 end; |
25 |
26 |
26 structure Isar: ISAR = |
27 structure Isar: ISAR = |
129 raw_loop secure src) |
130 raw_loop secure src) |
130 end; |
131 end; |
131 |
132 |
132 in |
133 in |
133 |
134 |
134 fun toplevel_loop {init = do_init, welcome, sync, secure} = |
135 fun toplevel_loop in_stream {init = do_init, welcome, sync, secure} = |
135 (Context.set_thread_data NONE; |
136 (Context.set_thread_data NONE; |
136 Secure.Isar_setup (); |
137 Secure.Isar_setup (); |
137 if do_init then init () else (); |
138 if do_init then init () else (); |
138 if welcome then writeln (Session.welcome ()) else (); |
139 if welcome then writeln (Session.welcome ()) else (); |
139 uninterruptible (fn _ => fn () => raw_loop secure (Outer_Syntax.isar sync)) ()); |
140 uninterruptible (fn _ => fn () => raw_loop secure (Outer_Syntax.isar in_stream sync)) ()); |
140 |
141 |
141 end; |
142 end; |
142 |
143 |
143 fun loop () = |
144 fun loop () = |
144 toplevel_loop {init = false, welcome = false, sync = false, secure = Secure.is_secure ()}; |
145 toplevel_loop TextIO.stdIn |
|
146 {init = false, welcome = false, sync = false, secure = Secure.is_secure ()}; |
145 |
147 |
146 fun main () = |
148 fun main () = |
147 toplevel_loop {init = true, welcome = true, sync = false, secure = Secure.is_secure ()}; |
149 toplevel_loop TextIO.stdIn |
|
150 {init = true, welcome = true, sync = false, secure = Secure.is_secure ()}; |
148 |
151 |
149 |
152 |
150 |
153 |
151 (** command syntax **) |
154 (** command syntax **) |
152 |
155 |