equal
deleted
inserted
replaced
251 val (name', parents, files) = ThyHeader.read (src, pos); |
251 val (name', parents, files) = ThyHeader.read (src, pos); |
252 val ml_path = ThyLoad.ml_path name; |
252 val ml_path = ThyLoad.ml_path name; |
253 val ml_file = if ml andalso is_some (ThyLoad.check_file NONE ml_path) then [ml_path] else []; |
253 val ml_file = if ml andalso is_some (ThyLoad.check_file NONE ml_path) then [ml_path] else []; |
254 in |
254 in |
255 if name <> name' then |
255 if name <> name' then |
256 error ("Filename " ^ quote (Path.pack path) ^ |
256 error ("Filename " ^ quote (Path.implode path) ^ |
257 " does not agree with theory name " ^ quote name') |
257 " does not agree with theory name " ^ quote name') |
258 else (parents, map (Path.unpack o #1) files @ ml_file) |
258 else (parents, map (Path.explode o #1) files @ ml_file) |
259 end; |
259 end; |
260 |
260 |
261 |
261 |
262 (* load_thy *) |
262 (* load_thy *) |
263 |
263 |
266 fun try_ml_file name time = |
266 fun try_ml_file name time = |
267 let val path = ThyLoad.ml_path name in |
267 let val path = ThyLoad.ml_path name in |
268 if is_none (ThyLoad.check_file NONE path) then () |
268 if is_none (ThyLoad.check_file NONE path) then () |
269 else |
269 else |
270 let |
270 let |
271 val _ = warning ("Loading legacy ML script " ^ quote (Path.pack path)); |
271 val _ = warning ("Loading legacy ML script " ^ quote (Path.implode path)); |
272 val tr = Toplevel.imperative (fn () => ThyInfo.load_file time path); |
272 val tr = Toplevel.imperative (fn () => ThyInfo.load_file time path); |
273 val tr_name = if time then "time_use" else "use"; |
273 val tr_name = if time then "time_use" else "use"; |
274 in Toplevel.excursion [Toplevel.empty |> Toplevel.name tr_name |> tr] end |
274 in Toplevel.excursion [Toplevel.empty |> Toplevel.name tr_name |> tr] end |
275 end; |
275 end; |
276 |
276 |