author | wenzelm |
Fri, 06 Oct 2017 17:13:57 +0200 | |
changeset 66770 | 122df1fde073 |
parent 64556 | 851ae0e7b09c |
child 67381 | 146757999c8d |
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 _ = |
64556 | 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 _ = |
64556 | 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 _ = |
64556 | 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 _ = |
64556 | 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 _ = |
64556 | 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 _ = |
|
64556 | 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 _ = |
|
64556 | 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 _ = |
64556 | 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 _ = |
64556 | 57 |
Outer_Syntax.command ("text_raw", \<^here>) "LaTeX text (without surrounding environment)" |
61464 | 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 _ = |
64556 | 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; |