| author | blanchet | 
| Tue, 30 Apr 2013 10:07:41 +0200 | |
| changeset 51828 | 67c6d6136915 | 
| parent 50239 | fb579401dc26 | 
| child 52408 | fa2dc6c6c94f | 
| permissions | -rw-r--r-- | 
| 48985 | 1  | 
(* Title: Doc/antiquote_setup.ML  | 
| 21375 | 2  | 
Author: Makarius  | 
3  | 
||
| 26742 | 4  | 
Auxiliary antiquotations for the Isabelle manuals.  | 
| 21375 | 5  | 
*)  | 
6  | 
||
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
7  | 
signature ANTIQUOTE_SETUP =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
8  | 
sig  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
9  | 
val setup: theory -> theory  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
10  | 
end;  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
11  | 
|
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
12  | 
structure Antiquote_Setup: ANTIQUOTE_SETUP =  | 
| 26742 | 13  | 
struct  | 
| 21375 | 14  | 
|
| 26742 | 15  | 
(* misc utils *)  | 
16  | 
||
| 
29736
 
ec3fc818b82e
clean_string/clean_name: proper treatment of \<dash>;
 
wenzelm 
parents: 
29726 
diff
changeset
 | 
17  | 
fun translate f = Symbol.explode #> map f #> implode;  | 
| 
 
ec3fc818b82e
clean_string/clean_name: proper treatment of \<dash>;
 
wenzelm 
parents: 
29726 
diff
changeset
 | 
18  | 
|
| 
 
ec3fc818b82e
clean_string/clean_name: proper treatment of \<dash>;
 
wenzelm 
parents: 
29726 
diff
changeset
 | 
19  | 
val clean_string = translate  | 
| 
26853
 
52cb0e965041
clean_string: map "_" to "\\_" (best used with underscore.sty);
 
wenzelm 
parents: 
26843 
diff
changeset
 | 
20  | 
(fn "_" => "\\_"  | 
| 
30120
 
aaa4667285c8
uniform treatment of ML indexing, using general \indexdef macro for formal Isabelle/Isar entities;
 
wenzelm 
parents: 
29736 
diff
changeset
 | 
21  | 
| "#" => "\\#"  | 
| 26897 | 22  | 
| "<" => "$<$"  | 
| 26768 | 23  | 
| ">" => "$>$"  | 
24  | 
    | "{" => "\\{"
 | 
|
| 
30120
 
aaa4667285c8
uniform treatment of ML indexing, using general \indexdef macro for formal Isabelle/Isar entities;
 
wenzelm 
parents: 
29736 
diff
changeset
 | 
25  | 
| "|" => "$\\mid$"  | 
| 26768 | 26  | 
| "}" => "\\}"  | 
| 42666 | 27  | 
| "\<hyphen>" => "-"  | 
| 26768 | 28  | 
| c => c);  | 
| 26751 | 29  | 
|
| 31546 | 30  | 
fun clean_name "\<dots>" = "dots"  | 
| 26897 | 31  | 
| clean_name ".." = "ddot"  | 
32  | 
| clean_name "." = "dot"  | 
|
| 26910 | 33  | 
| clean_name "_" = "underscore"  | 
| 26897 | 34  | 
  | clean_name "{" = "braceleft"
 | 
35  | 
| clean_name "}" = "braceright"  | 
|
| 42666 | 36  | 
| clean_name s = s |> translate (fn "_" => "-" | "\<hyphen>" => "-" | c => c);  | 
| 26897 | 37  | 
|
| 26742 | 38  | 
|
39  | 
(* verbatim text *)  | 
|
40  | 
||
41  | 
val verbatim = space_implode "\\verb,|," o map (enclose "\\verb|" "|") o space_explode "|";  | 
|
42  | 
||
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
43  | 
val verbatim_setup =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
44  | 
  Thy_Output.antiquotation @{binding verbatim} (Scan.lift Args.name)
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
45  | 
(K (split_lines #> map verbatim #> space_implode "\\isasep\\isanewline%\n"));  | 
| 26742 | 46  | 
|
47  | 
||
48  | 
(* ML text *)  | 
|
49  | 
||
50  | 
local  | 
|
51  | 
||
| 21375 | 52  | 
fun ml_val (txt1, "") = "fn _ => (" ^ txt1 ^ ");"
 | 
| 
39858
 
5be7a57c3b4e
more robust treatment of symbolic indentifiers (which may contain colons);
 
wenzelm 
parents: 
39829 
diff
changeset
 | 
53  | 
  | ml_val (txt1, txt2) = "fn _ => (" ^ txt1 ^ " : " ^ txt2 ^ ");";
 | 
| 21375 | 54  | 
|
| 46261 | 55  | 
fun ml_op (txt1, "") = "fn _ => (op " ^ txt1 ^ ");"  | 
56  | 
| ml_op (txt1, txt2) = "fn _ => (op " ^ txt1 ^ " : " ^ txt2 ^ ");";  | 
|
57  | 
||
| 21375 | 58  | 
fun ml_type (txt1, "") = "val _ = NONE : (" ^ txt1 ^ ") option;"
 | 
59  | 
  | ml_type (txt1, txt2) = "val _ = [NONE : (" ^ txt1 ^ ") option, NONE : (" ^ txt2 ^ ") option];";
 | 
|
| 22289 | 60  | 
|
| 
39858
 
5be7a57c3b4e
more robust treatment of symbolic indentifiers (which may contain colons);
 
wenzelm 
parents: 
39829 
diff
changeset
 | 
61  | 
fun ml_exn (txt1, "") = "fn _ => (" ^ txt1 ^ " : exn);"
 | 
| 
 
5be7a57c3b4e
more robust treatment of symbolic indentifiers (which may contain colons);
 
wenzelm 
parents: 
39829 
diff
changeset
 | 
62  | 
  | ml_exn (txt1, txt2) = "fn _ => (" ^ txt1 ^ " : " ^ txt2 ^ " -> exn);";
 | 
| 22289 | 63  | 
|
| 30394 | 64  | 
fun ml_structure (txt, _) = "functor XXX() = struct structure XX = " ^ txt ^ " end;";  | 
| 21375 | 65  | 
|
| 
36163
 
823c9400eb62
proper checking of ML functors (in Poly/ML 5.2 or later);
 
wenzelm 
parents: 
31546 
diff
changeset
 | 
66  | 
fun ml_functor (txt, _) = "ML_Env.check_functor " ^ ML_Syntax.print_string txt;  | 
| 21375 | 67  | 
|
| 
39869
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
68  | 
val is_name = ML_Lex.kind_of #> (fn kind => kind = ML_Lex.Ident orelse kind = ML_Lex.LongIdent);  | 
| 
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
69  | 
|
| 
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
70  | 
fun ml_name txt =  | 
| 
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
71  | 
(case filter is_name (ML_Lex.tokenize txt) of  | 
| 
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
72  | 
toks as [_] => ML_Lex.flatten toks  | 
| 
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
73  | 
  | _ => error ("Single ML name expected in input: " ^ quote txt));
 | 
| 
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
74  | 
|
| 
37216
 
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
 
wenzelm 
parents: 
37198 
diff
changeset
 | 
75  | 
fun index_ml name kind ml = Thy_Output.antiquotation name  | 
| 30394 | 76  | 
(Scan.lift (Args.name -- Scan.optional (Args.colon |-- Args.name) ""))  | 
77  | 
  (fn {context = ctxt, ...} => fn (txt1, txt2) =>
 | 
|
78  | 
let  | 
|
79  | 
val txt =  | 
|
80  | 
if txt2 = "" then txt1  | 
|
81  | 
else if kind = "type" then txt1 ^ " = " ^ txt2  | 
|
82  | 
else if kind = "exception" then txt1 ^ " of " ^ txt2  | 
|
| 50239 | 83  | 
else if Symbol_Pos.is_identifier (Long_Name.base_name (ml_name txt1))  | 
| 
42290
 
b1f544c84040
discontinued special treatment of structure Lexicon;
 
wenzelm 
parents: 
40801 
diff
changeset
 | 
84  | 
then txt1 ^ ": " ^ txt2  | 
| 
39858
 
5be7a57c3b4e
more robust treatment of symbolic indentifiers (which may contain colons);
 
wenzelm 
parents: 
39829 
diff
changeset
 | 
85  | 
else txt1 ^ " : " ^ txt2;  | 
| 30394 | 86  | 
val txt' = if kind = "" then txt else kind ^ " " ^ txt;  | 
| 
37198
 
3af985b10550
replaced ML_Lex.read_antiq by more concise ML_Lex.read, which includes full read/report with explicit position information;
 
wenzelm 
parents: 
36973 
diff
changeset
 | 
87  | 
val _ = ML_Context.eval_text_in (SOME ctxt) false Position.none (ml (txt1, txt2)); (* ML_Lex.read (!?) *)  | 
| 30394 | 88  | 
val kind' = if kind = "" then "ML" else "ML " ^ kind;  | 
89  | 
in  | 
|
| 
39869
 
c269f6bd0a1f
more robust index_ML antiquotations: guess name from text (affects infixes and type constructors in particular);
 
wenzelm 
parents: 
39858 
diff
changeset
 | 
90  | 
      "\\indexdef{}{" ^ kind' ^ "}{" ^ clean_string (ml_name txt1) ^ "}" ^
 | 
| 30394 | 91  | 
(txt'  | 
| 
38767
 
d8da44a8dd25
proper context for various Thy_Output options, via official configuration options in ML and Isar;
 
wenzelm 
parents: 
37982 
diff
changeset
 | 
92  | 
|> (if Config.get ctxt Thy_Output.quotes then quote else I)  | 
| 
 
d8da44a8dd25
proper context for various Thy_Output options, via official configuration options in ML and Isar;
 
wenzelm 
parents: 
37982 
diff
changeset
 | 
93  | 
      |> (if Config.get ctxt Thy_Output.display then enclose "\\begin{verbatim}\n" "\n\\end{verbatim}"
 | 
| 30394 | 94  | 
else split_lines #> map verbatim #> space_implode "\\isasep\\isanewline%\n"))  | 
95  | 
end);  | 
|
| 26742 | 96  | 
|
97  | 
in  | 
|
| 21375 | 98  | 
|
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
99  | 
val index_ml_setup =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
100  | 
  index_ml @{binding index_ML} "" ml_val #>
 | 
| 46261 | 101  | 
  index_ml @{binding index_ML_op} "infix" ml_op #>
 | 
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
102  | 
  index_ml @{binding index_ML_type} "type" ml_type #>
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
103  | 
  index_ml @{binding index_ML_exn} "exception" ml_exn #>
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
104  | 
  index_ml @{binding index_ML_structure} "structure" ml_structure #>
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
105  | 
  index_ml @{binding index_ML_functor} "functor" ml_functor;
 | 
| 21375 | 106  | 
|
| 26742 | 107  | 
end;  | 
| 21375 | 108  | 
|
| 23846 | 109  | 
|
| 30394 | 110  | 
(* named theorems *)  | 
| 23846 | 111  | 
|
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
112  | 
val named_thms_setup =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
113  | 
  Thy_Output.antiquotation @{binding named_thms}
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
114  | 
(Scan.repeat (Attrib.thm -- Scan.lift (Args.parens Args.name)))  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
115  | 
    (fn {context = ctxt, ...} =>
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
116  | 
map (apfst (Thy_Output.pretty_thm ctxt))  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
117  | 
#> (if Config.get ctxt Thy_Output.quotes then map (apfst Pretty.quote) else I)  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
118  | 
#> (if Config.get ctxt Thy_Output.display  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
119  | 
then  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
120  | 
map (fn (p, name) =>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
121  | 
Output.output (Pretty.string_of (Pretty.indent (Config.get ctxt Thy_Output.indent) p)) ^  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
122  | 
              "\\rulename{" ^ Output.output (Pretty.str_of (Thy_Output.pretty_text ctxt name)) ^ "}")
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
123  | 
#> space_implode "\\par\\smallskip%\n"  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
124  | 
            #> enclose "\\begin{isabelle}%\n" "%\n\\end{isabelle}"
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
125  | 
else  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
126  | 
map (fn (p, name) =>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
127  | 
Output.output (Pretty.str_of p) ^  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
128  | 
              "\\rulename{" ^ Output.output (Pretty.str_of (Thy_Output.pretty_text ctxt name)) ^ "}")
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
129  | 
#> space_implode "\\par\\smallskip%\n"  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
130  | 
            #> enclose "\\isa{" "}"));
 | 
| 26742 | 131  | 
|
132  | 
||
| 30394 | 133  | 
(* theory file *)  | 
| 26742 | 134  | 
|
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
135  | 
val thy_file_setup =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
136  | 
  Thy_Output.antiquotation @{binding thy_file} (Scan.lift Args.name)
 | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
137  | 
    (fn {context = ctxt, ...} =>
 | 
| 48899 | 138  | 
fn name => (Thy_Load.check_thy Path.current name; Thy_Output.output ctxt [Pretty.str name]));  | 
| 26742 | 139  | 
|
| 26751 | 140  | 
|
| 30394 | 141  | 
(* Isabelle/Isar entities (with index) *)  | 
| 26751 | 142  | 
|
143  | 
local  | 
|
144  | 
||
| 26894 | 145  | 
fun no_check _ _ = true;  | 
146  | 
||
147  | 
fun thy_check intern defined ctxt =  | 
|
| 42361 | 148  | 
let val thy = Proof_Context.theory_of ctxt  | 
| 26894 | 149  | 
in defined thy o intern thy end;  | 
150  | 
||
| 28237 | 151  | 
fun check_tool name =  | 
| 47825 | 152  | 
let val tool_dirs = map Path.explode ["~~/lib/Tools", "~~/src/Tools/jEdit/lib/Tools"]  | 
153  | 
in exists (fn dir => File.exists (Path.append dir (Path.basic name))) tool_dirs end;  | 
|
| 28237 | 154  | 
|
| 26751 | 155  | 
val arg = enclose "{" "}" o clean_string;
 | 
156  | 
||
| 30394 | 157  | 
fun entity check markup kind index =  | 
| 
37216
 
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
 
wenzelm 
parents: 
37198 
diff
changeset
 | 
158  | 
Thy_Output.antiquotation  | 
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
159  | 
(Binding.name (translate (fn " " => "_" | c => c) kind ^  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
160  | 
(case index of NONE => "" | SOME true => "_def" | SOME false => "_ref")))  | 
| 30394 | 161  | 
(Scan.lift (Scan.optional (Args.parens Args.name) "" -- Args.name))  | 
162  | 
    (fn {context = ctxt, ...} => fn (logic, name) =>
 | 
|
163  | 
let  | 
|
164  | 
val hyper_name =  | 
|
165  | 
          "{" ^ Long_Name.append kind (Long_Name.append logic (clean_name name)) ^ "}";
 | 
|
166  | 
val hyper =  | 
|
167  | 
          enclose ("\\hyperlink" ^ hyper_name ^ "{") "}" #>
 | 
|
168  | 
          index = SOME true ? enclose ("\\hypertarget" ^ hyper_name ^ "{") "}";
 | 
|
169  | 
val idx =  | 
|
170  | 
(case index of  | 
|
171  | 
NONE => ""  | 
|
172  | 
| SOME is_def =>  | 
|
173  | 
"\\index" ^ (if is_def then "def" else "ref") ^ arg logic ^ arg kind ^ arg name);  | 
|
174  | 
in  | 
|
175  | 
if check ctxt name then  | 
|
176  | 
idx ^  | 
|
177  | 
(Output.output name  | 
|
178  | 
            |> (if markup = "" then I else enclose ("\\" ^ markup ^ "{") "}")
 | 
|
| 
38767
 
d8da44a8dd25
proper context for various Thy_Output options, via official configuration options in ML and Isar;
 
wenzelm 
parents: 
37982 
diff
changeset
 | 
179  | 
|> (if Config.get ctxt Thy_Output.quotes then quote else I)  | 
| 
 
d8da44a8dd25
proper context for various Thy_Output options, via official configuration options in ML and Isar;
 
wenzelm 
parents: 
37982 
diff
changeset
 | 
180  | 
|> (if Config.get ctxt Thy_Output.display  | 
| 
 
d8da44a8dd25
proper context for various Thy_Output options, via official configuration options in ML and Isar;
 
wenzelm 
parents: 
37982 
diff
changeset
 | 
181  | 
                then enclose "\\begin{isabelle}%\n" "%\n\\end{isabelle}"
 | 
| 30394 | 182  | 
                else hyper o enclose "\\mbox{\\isa{" "}}"))
 | 
183  | 
        else error ("Bad " ^ kind ^ " " ^ quote name)
 | 
|
184  | 
end);  | 
|
| 26897 | 185  | 
|
| 26894 | 186  | 
fun entity_antiqs check markup kind =  | 
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
187  | 
entity check markup kind NONE #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
188  | 
entity check markup kind (SOME true) #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
189  | 
entity check markup kind (SOME false);  | 
| 26751 | 190  | 
|
191  | 
in  | 
|
192  | 
||
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
193  | 
val entity_setup =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
194  | 
entity_antiqs no_check "" "syntax" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
195  | 
entity_antiqs (K (is_some o Keyword.command_keyword)) "isacommand" "command" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
196  | 
entity_antiqs (K Keyword.is_keyword) "isakeyword" "keyword" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
197  | 
entity_antiqs (K Keyword.is_keyword) "isakeyword" "element" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
198  | 
entity_antiqs (thy_check Method.intern Method.defined) "" "method" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
199  | 
entity_antiqs (thy_check Attrib.intern Attrib.defined) "" "attribute" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
200  | 
entity_antiqs no_check "" "fact" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
201  | 
entity_antiqs no_check "" "variable" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
202  | 
entity_antiqs no_check "" "case" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
203  | 
entity_antiqs (thy_check Thy_Output.intern_command Thy_Output.defined_command)  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
204  | 
"" "antiquotation" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
205  | 
entity_antiqs (thy_check Thy_Output.intern_option Thy_Output.defined_option)  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
206  | 
"" "antiquotation option" #>  | 
| 
48554
 
011cbb395d46
no_check for @{setting} antiquotations -- empty values are treated as undefined on Cygwin;
 
wenzelm 
parents: 
47825 
diff
changeset
 | 
207  | 
entity_antiqs no_check "isatt" "setting" #>  | 
| 48578 | 208  | 
entity_antiqs no_check "isatt" "system option" #>  | 
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
209  | 
entity_antiqs no_check "" "inference" #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
210  | 
entity_antiqs no_check "isatt" "executable" #>  | 
| 48602 | 211  | 
entity_antiqs (K check_tool) "isatool" "tool" #>  | 
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
212  | 
entity_antiqs (thy_check ML_Context.intern_antiq ML_Context.defined_antiq)  | 
| 
50201
 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 
wenzelm 
parents: 
48985 
diff
changeset
 | 
213  | 
"" Markup.ML_antiquotationN;  | 
| 26751 | 214  | 
|
| 26742 | 215  | 
end;  | 
| 26751 | 216  | 
|
| 
43564
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
217  | 
|
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
218  | 
(* theory setup *)  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
219  | 
|
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
220  | 
val setup =  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
221  | 
verbatim_setup #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
222  | 
index_ml_setup #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
223  | 
named_thms_setup #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
224  | 
thy_file_setup #>  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
225  | 
entity_setup;  | 
| 
 
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
 
wenzelm 
parents: 
43563 
diff
changeset
 | 
226  | 
|
| 26751 | 227  | 
end;  |