209 in () end; |
209 in () end; |
210 |
210 |
211 (*PIDE version*) |
211 (*PIDE version*) |
212 val _ = |
212 val _ = |
213 Isabelle_Process.protocol_command "build_session" |
213 Isabelle_Process.protocol_command "build_session" |
214 (fn [id, yxml] => |
214 (fn [args_yxml] => |
215 let |
215 let |
216 val args = decode_args yxml; |
216 val args = decode_args args_yxml; |
217 val result = (build_session args; "") handle exn => |
217 val result = (build_session args; "") handle exn => |
218 (Runtime.exn_message exn handle _ (*sic!*) => |
218 (Runtime.exn_message exn handle _ (*sic!*) => |
219 "Exception raised, but failed to print details!"); |
219 "Exception raised, but failed to print details!"); |
220 in Output.protocol_message (Markup.build_theories_result id) [result] end | _ => raise Match); |
220 in Output.protocol_message Markup.build_session_finished [result] end | _ => raise Match); |
221 |
|
222 val _ = |
|
223 Isabelle_Process.protocol_command "build_theories" |
|
224 (fn [id, symbol_codes_yxml, master_dir, theories_yxml] => |
|
225 let |
|
226 val symbols = |
|
227 YXML.parse_body symbol_codes_yxml |
|
228 |> let open XML.Decode in list (pair string int) end |
|
229 |> HTML.make_symbols; |
|
230 val theories = |
|
231 YXML.parse_body theories_yxml |> |
|
232 let open XML.Decode |
|
233 in list (pair Options.decode (list (string #> rpair Position.none))) end; |
|
234 val res1 = |
|
235 Exn.capture |
|
236 (fn () => |
|
237 theories |
|
238 |> List.app (build_theories symbols (K Time.zeroTime) (Path.explode master_dir))) (); |
|
239 val res2 = Exn.capture Session.shutdown (); |
|
240 val result = |
|
241 (Par_Exn.release_all [res1, res2]; "") handle exn => |
|
242 (Runtime.exn_message exn handle _ (*sic!*) => |
|
243 "Exception raised, but failed to print details!"); |
|
244 in Output.protocol_message (Markup.build_theories_result id) [result] end | _ => raise Match); |
|
245 |
221 |
246 end; |
222 end; |