author | nipkow |
Mon, 07 Jul 2014 17:01:11 +0200 | |
changeset 57530 | 439f881c8744 |
parent 56895 | f058120aaad4 |
child 58842 | 22b87ab47d3b |
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 |
|
56204 | 12 |
(("theory", Keyword.tag_theory Keyword.thy_begin), @{here}) "begin theory" |
48879 | 13 |
(Thy_Header.args >> (fn header => |
56895
f058120aaad4
discontinued Toplevel.print flag -- print uniformly according to Keyword.is_printed;
wenzelm
parents:
56618
diff
changeset
|
14 |
Toplevel.init_theory |
f058120aaad4
discontinued Toplevel.print flag -- print uniformly according to Keyword.is_printed;
wenzelm
parents:
56618
diff
changeset
|
15 |
(fn () => Thy_Info.toplevel_begin_theory (! ProofGeneral.master_path) header))); |
48879 | 16 |
|
17 |
val _ = |
|
18 |
Outer_Syntax.command |
|
56204 | 19 |
(("ML_file", Keyword.tag_ml Keyword.thy_load), @{here}) "ML text from file" |
56208 | 20 |
(Resources.parse_files "ML_file" >> (fn files => Toplevel.generic_theory (fn gthy => |
48879 | 21 |
let |
55788
67699e08e969
store blobs / inlined files as separate text lines: smaller values are more healthy for the Poly/ML RTS and allow implicit sharing;
wenzelm
parents:
54450
diff
changeset
|
22 |
val [{src_path, lines, digest, pos}] = files (Context.theory_of gthy); |
56208 | 23 |
val provide = Resources.provide (src_path, digest); |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55788
diff
changeset
|
24 |
val source = {delimited = true, text = cat_lines lines, pos = pos}; |
56618
874bdedb2313
added command 'SML_export' and 'SML_import' for exchange of toplevel bindings;
wenzelm
parents:
56304
diff
changeset
|
25 |
val flags = {SML = false, exchange = false, redirect = true, verbose = true}; |
48879 | 26 |
in |
27 |
gthy |
|
56304
40274e4f5ebf
redirect ML_Compiler reports more directly: only the (big) parse tree report is deferred via Execution.print (NB: this does not work for asynchronous "diag" commands);
wenzelm
parents:
56275
diff
changeset
|
28 |
|> ML_Context.exec (fn () => ML_Context.eval_source flags source) |
48879 | 29 |
|> Local_Theory.propagate_ml_env |
30 |
|> Context.mapping provide (Local_Theory.background_theory provide) |
|
31 |
end))); |
|
32 |
||
33 |
end; |
|
34 |