author | wenzelm |
Sat, 16 Nov 2013 17:52:01 +0100 | |
changeset 54450 | 7815563f50dc |
parent 52546 | 7118524a2a24 |
child 55788 | 67699e08e969 |
permissions | -rw-r--r-- |
48879 | 1 |
(* Title: Pure/pure_syn.ML |
2 |
Author: Makarius |
|
3 |
||
52546 | 4 |
Minimal outer syntax for bootstrapping Isabelle/Pure. |
48879 | 5 |
*) |
6 |
||
7 |
structure Pure_Syn: sig end = |
|
8 |
struct |
|
9 |
||
10 |
val _ = |
|
11 |
Outer_Syntax.command |
|
52455 | 12 |
(("theory", Keyword.tag_theory Keyword.thy_begin), Position.file "pure_syn.ML") |
13 |
"begin theory context" |
|
48879 | 14 |
(Thy_Header.args >> (fn header => |
15 |
Toplevel.print o |
|
16 |
Toplevel.init_theory |
|
54450
7815563f50dc
tuned signature -- clarified Proof General legacy;
wenzelm
parents:
52546
diff
changeset
|
17 |
(fn () => Thy_Info.toplevel_begin_theory (! ProofGeneral.master_path) header))); |
48879 | 18 |
|
19 |
val _ = |
|
20 |
Outer_Syntax.command |
|
52455 | 21 |
(("ML_file", Keyword.tag_ml Keyword.thy_load), Position.file "pure_syn.ML") |
22 |
"ML text from file" |
|
48905 | 23 |
(Thy_Load.parse_files "ML_file" >> (fn files => Toplevel.generic_theory (fn gthy => |
48879 | 24 |
let |
48905 | 25 |
val [{src_path, text, pos}] = files (Context.theory_of gthy); |
26 |
val provide = Thy_Load.provide (src_path, SHA1.digest text); |
|
48879 | 27 |
in |
28 |
gthy |
|
48905 | 29 |
|> ML_Context.exec (fn () => ML_Context.eval_text true pos text) |
48879 | 30 |
|> Local_Theory.propagate_ml_env |
31 |
|> Context.mapping provide (Local_Theory.background_theory provide) |
|
32 |
end))); |
|
33 |
||
34 |
end; |
|
35 |