author | wenzelm |
Sat, 09 Apr 2016 19:09:11 +0200 | |
changeset 62931 | 09b516854210 |
parent 62912 | 745d31e63c21 |
child 64556 | 851ae0e7b09c |
permissions | -rw-r--r-- |
48879 | 1 |
(* Title: Pure/pure_syn.ML |
2 |
Author: Makarius |
|
3 |
||
60096 | 4 |
Outer syntax for bootstrapping: commands that are accessible outside a |
5 |
regular theory context. |
|
48879 | 6 |
*) |
7 |
||
60095 | 8 |
signature PURE_SYN = |
9 |
sig |
|
10 |
val bootstrap_thy: theory |
|
11 |
end; |
|
12 |
||
13 |
structure Pure_Syn: PURE_SYN = |
|
48879 | 14 |
struct |
15 |
||
62912 | 16 |
val semi = Scan.option (Parse.$$$ ";"); |
17 |
||
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
18 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
19 |
Outer_Syntax.command ("chapter", @{here}) "chapter heading" |
62912 | 20 |
(Parse.opt_target -- Parse.document_source --| semi |
21 |
>> Thy_Output.document_command {markdown = false}); |
|
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
22 |
|
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
23 |
val _ = |
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
24 |
Outer_Syntax.command ("section", @{here}) "section heading" |
62912 | 25 |
(Parse.opt_target -- Parse.document_source --| semi |
26 |
>> Thy_Output.document_command {markdown = false}); |
|
58918 | 27 |
|
48879 | 28 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
29 |
Outer_Syntax.command ("subsection", @{here}) "subsection heading" |
62912 | 30 |
(Parse.opt_target -- Parse.document_source --| semi |
31 |
>> Thy_Output.document_command {markdown = false}); |
|
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
32 |
|
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
33 |
val _ = |
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
34 |
Outer_Syntax.command ("subsubsection", @{here}) "subsubsection heading" |
62912 | 35 |
(Parse.opt_target -- Parse.document_source --| semi |
36 |
>> Thy_Output.document_command {markdown = false}); |
|
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
37 |
|
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
38 |
val _ = |
61463 | 39 |
Outer_Syntax.command ("paragraph", @{here}) "paragraph heading" |
62912 | 40 |
(Parse.opt_target -- Parse.document_source --| semi |
41 |
>> Thy_Output.document_command {markdown = false}); |
|
61463 | 42 |
|
43 |
val _ = |
|
44 |
Outer_Syntax.command ("subparagraph", @{here}) "subparagraph heading" |
|
62912 | 45 |
(Parse.opt_target -- Parse.document_source --| semi |
46 |
>> Thy_Output.document_command {markdown = false}); |
|
61463 | 47 |
|
48 |
val _ = |
|
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
49 |
Outer_Syntax.command ("text", @{here}) "formal comment (primary style)" |
61457 | 50 |
(Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = true}); |
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
51 |
|
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
52 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
53 |
Outer_Syntax.command ("txt", @{here}) "formal comment (secondary style)" |
61457 | 54 |
(Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = true}); |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
55 |
|
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
56 |
val _ = |
61464 | 57 |
Outer_Syntax.command ("text_raw", @{here}) "LaTeX text (without surrounding environment)" |
58 |
(Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = true}); |
|
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
59 |
|
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
60 |
val _ = |
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
61 |
Outer_Syntax.command ("theory", @{here}) "begin theory" |
58852 | 62 |
(Thy_Header.args >> |
63 |
(fn _ => Toplevel.init_theory (fn () => error "Missing theory initialization"))); |
|
48879 | 64 |
|
60095 | 65 |
|
62876 | 66 |
val bootstrap_thy = Context.the_global_context (); |
60095 | 67 |
|
68 |
val _ = Theory.setup (Config.put_global Outer_Syntax.bootstrap false); |
|
69 |
||
48879 | 70 |
end; |