author | blanchet |
Mon, 30 Nov 2015 13:14:56 +0100 | |
changeset 61755 | 6af17b2b773d |
parent 61660 | 78b371644654 |
child 61862 | e2a9e46ac0fb |
permissions | -rw-r--r-- |
45670 | 1 |
(* Title: Pure/PIDE/markup.ML |
23623 | 2 |
Author: Makarius |
3 |
||
56743 | 4 |
Quasi-abstract markup elements. |
23623 | 5 |
*) |
6 |
||
7 |
signature MARKUP = |
|
8 |
sig |
|
51951
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
9 |
val parse_bool: string -> bool |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
10 |
val print_bool: bool -> string |
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
11 |
val parse_int: string -> int |
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
12 |
val print_int: int -> string |
51988 | 13 |
val parse_real: string -> real |
14 |
val print_real: real -> string |
|
28017 | 15 |
type T = string * Properties.T |
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
16 |
val empty: T |
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
17 |
val is_empty: T -> bool |
38229 | 18 |
val properties: Properties.T -> T -> T |
23623 | 19 |
val nameN: string |
27818 | 20 |
val name: string -> T -> T |
38887
1261481ef5e5
Command.State: add reported positions to markup tree, according main message position or Markup.binding/entity/report occurrences in body;
wenzelm
parents:
38871
diff
changeset
|
21 |
val kindN: string |
60744 | 22 |
val serialN: string |
23 |
val serial_properties: int -> Properties.T |
|
52854
92932931bd82
more general Output.result: allow to update arbitrary properties;
wenzelm
parents:
52800
diff
changeset
|
24 |
val instanceN: string |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
25 |
val languageN: string |
55615
bf4bbe72f740
completion of keywords and symbols based on language context;
wenzelm
parents:
55613
diff
changeset
|
26 |
val symbolsN: string |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
27 |
val delimitedN: string |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
28 |
val is_delimited: Properties.T -> bool |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
29 |
val language: {name: string, symbols: bool, antiquotes: bool, delimited: bool} -> T |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
30 |
val language': {name: string, symbols: bool, antiquotes: bool} -> bool -> T |
61614 | 31 |
val language_outer: bool -> T |
55761
213b9811f59f
method language markup, e.g. relevant to prevent outer keyword completion;
wenzelm
parents:
55750
diff
changeset
|
32 |
val language_method: T |
56033 | 33 |
val language_attribute: T |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
34 |
val language_sort: bool -> T |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
35 |
val language_type: bool -> T |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
36 |
val language_term: bool -> T |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
37 |
val language_prop: bool -> T |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
38 |
val language_ML: bool -> T |
56278
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents:
56202
diff
changeset
|
39 |
val language_SML: bool -> T |
61600
1ca11ddfcc70
clarified completion of explicit symbols (see also f6bd97a587b7, e0e4ac981cf1);
wenzelm
parents:
61598
diff
changeset
|
40 |
val language_document: bool -> T |
55653
528de9a20054
more markup -- complete symbols within antiquotation, notably with broken arguments;
wenzelm
parents:
55615
diff
changeset
|
41 |
val language_antiquotation: T |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
42 |
val language_text: bool -> T |
55613 | 43 |
val language_rail: T |
56034
1c59b555ac4a
some Markup.language_path to prevent completion of symbols (notably "~") -- always "delimited" for simplicity in contrast to 42ac3cfb89f6;
wenzelm
parents:
56033
diff
changeset
|
44 |
val language_path: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
45 |
val bindingN: string val binding: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
46 |
val entityN: string val entity: string -> string -> T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
47 |
val get_entity_kind: T -> string option |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
48 |
val defN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
49 |
val refN: string |
55694
a1184dfb8e00
clarified semantic completion: retain kind.full_name as official item name for history;
wenzelm
parents:
55687
diff
changeset
|
50 |
val completionN: string val completion: T |
55914
c5b752d549e3
clarified init_assignable: make double-sure that initial values are reset;
wenzelm
parents:
55837
diff
changeset
|
51 |
val no_completionN: string val no_completion: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
52 |
val lineN: string |
58978
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents:
58855
diff
changeset
|
53 |
val end_lineN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
54 |
val offsetN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
55 |
val end_offsetN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
56 |
val fileN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
57 |
val idN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
58 |
val position_properties': string list |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
59 |
val position_properties: string list |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
60 |
val positionN: string val position: T |
58464 | 61 |
val expressionN: string val expression: T |
58545
30b75b7958d6
citation tooltip/hyperlink based on open buffers with .bib files;
wenzelm
parents:
58544
diff
changeset
|
62 |
val citationN: string val citation: string -> T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
63 |
val pathN: string val path: string -> T |
54702
3daeba5130f0
added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents:
53378
diff
changeset
|
64 |
val urlN: string val url: string -> T |
61660
78b371644654
added antiquotation @{doc}, e.g. useful for demonstration purposes;
wenzelm
parents:
61614
diff
changeset
|
65 |
val docN: string val doc: string -> T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
66 |
val indentN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
67 |
val blockN: string val block: int -> T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
68 |
val widthN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
69 |
val breakN: string val break: int -> T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
70 |
val fbreakN: string val fbreak: T |
51570
3633828d80fc
basic support for Pretty.item, which is considered as logical markup and interpreted in Isabelle/Scala, but ignored elsewhere (TTY, latex etc.);
wenzelm
parents:
51228
diff
changeset
|
71 |
val itemN: string val item: T |
56548 | 72 |
val wordsN: string val words: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
73 |
val hiddenN: string val hidden: T |
56465 | 74 |
val system_optionN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
75 |
val theoryN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
76 |
val classN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
77 |
val type_nameN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
78 |
val constantN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
79 |
val fixedN: string val fixed: string -> T |
53378
07990ba8c0ea
cases: more position information and PIDE markup;
wenzelm
parents:
53055
diff
changeset
|
80 |
val caseN: string val case_: string -> T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
81 |
val dynamic_factN: string val dynamic_fact: string -> T |
58048
aa6296d09e0e
more explicit Method.modifier with reported position;
wenzelm
parents:
57975
diff
changeset
|
82 |
val method_modifierN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
83 |
val tfreeN: string val tfree: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
84 |
val tvarN: string val tvar: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
85 |
val freeN: string val free: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
86 |
val skolemN: string val skolem: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
87 |
val boundN: string val bound: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
88 |
val varN: string val var: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
89 |
val numeralN: string val numeral: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
90 |
val literalN: string val literal: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
91 |
val delimiterN: string val delimiter: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
92 |
val inner_stringN: string val inner_string: T |
55033 | 93 |
val inner_cartoucheN: string val inner_cartouche: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
94 |
val inner_commentN: string val inner_comment: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
95 |
val token_rangeN: string val token_range: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
96 |
val sortingN: string val sorting: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
97 |
val typingN: string val typing: T |
55505 | 98 |
val ML_keyword1N: string val ML_keyword1: T |
99 |
val ML_keyword2N: string val ML_keyword2: T |
|
100 |
val ML_keyword3N: string val ML_keyword3: T |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
101 |
val ML_delimiterN: string val ML_delimiter: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
102 |
val ML_tvarN: string val ML_tvar: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
103 |
val ML_numeralN: string val ML_numeral: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
104 |
val ML_charN: string val ML_char: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
105 |
val ML_stringN: string val ML_string: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
106 |
val ML_commentN: string val ML_comment: T |
56278
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents:
56202
diff
changeset
|
107 |
val SML_stringN: string val SML_string: T |
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents:
56202
diff
changeset
|
108 |
val SML_commentN: string val SML_comment: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
109 |
val ML_defN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
110 |
val ML_openN: string |
55837 | 111 |
val ML_structureN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
112 |
val ML_typingN: string val ML_typing: T |
60744 | 113 |
val ML_breakpointN: string val ML_breakpoint: int -> T |
55526 | 114 |
val antiquotedN: string val antiquoted: T |
115 |
val antiquoteN: string val antiquote: T |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
116 |
val ML_antiquotationN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
117 |
val document_antiquotationN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
118 |
val document_antiquotation_optionN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
119 |
val paragraphN: string val paragraph: T |
50545
00bdc48c5f71
explicit text_fold markup, which is used by default in Pretty.chunks/chunks2;
wenzelm
parents:
50543
diff
changeset
|
120 |
val text_foldN: string val text_fold: T |
61449 | 121 |
val markdown_paragraphN: string val markdown_paragraph: T |
122 |
val markdown_listN: string val markdown_list: string -> T |
|
123 |
val markdown_itemN: string val markdown_item: int -> T |
|
59795 | 124 |
val inputN: string val input: bool -> Properties.T -> T |
59935 | 125 |
val command_keywordN: string val command_keyword: T |
55750
baa7a1e57f4a
back to Markup.command for actual tokens (amending 4a4e5686e091) -- avoid conflict of jEdit token marker with Rendering.text_colors;
wenzelm
parents:
55744
diff
changeset
|
126 |
val commandN: string val command: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
127 |
val stringN: string val string: T |
59081 | 128 |
val alt_stringN: string val alt_string: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
129 |
val verbatimN: string val verbatim: T |
55033 | 130 |
val cartoucheN: string val cartouche: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
131 |
val commentN: string val comment: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
132 |
val keyword1N: string val keyword1: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
133 |
val keyword2N: string val keyword2: T |
55763 | 134 |
val keyword3N: string val keyword3: T |
55919
2eb8c13339a5
more explicit quasi_keyword markup, for Args.$$$ material, which is somewhere in between of outer and inner syntax;
wenzelm
parents:
55914
diff
changeset
|
135 |
val quasi_keywordN: string val quasi_keyword: T |
56202 | 136 |
val improperN: string val improper: T |
137 |
val operatorN: string val operator: T |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
138 |
val elapsedN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
139 |
val cpuN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
140 |
val gcN: string |
51606
2843cc095a57
additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
wenzelm
parents:
51570
diff
changeset
|
141 |
val timing_properties: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> Properties.T |
2843cc095a57
additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
wenzelm
parents:
51570
diff
changeset
|
142 |
val parse_timing_properties: Properties.T -> {elapsed: Time.time, cpu: Time.time, gc: Time.time} |
51228 | 143 |
val command_timingN: string |
144 |
val command_timing_properties: |
|
145 |
{file: string, offset: int, name: string} -> Time.time -> Properties.T |
|
146 |
val parse_command_timing_properties: |
|
147 |
Properties.T -> ({file: string, offset: int, name: string} * Time.time) option |
|
51606
2843cc095a57
additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
wenzelm
parents:
51570
diff
changeset
|
148 |
val timingN: string val timing: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
149 |
val subgoalsN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
150 |
val proof_stateN: string val proof_state: int -> T |
50543 | 151 |
val goalN: string val goal: T |
50537
08ce81aeeacc
more subgoal markup information, which is potentially useful to manage proof state output;
wenzelm
parents:
50503
diff
changeset
|
152 |
val subgoalN: string val subgoal: string -> T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
153 |
val taskN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
154 |
val acceptedN: string val accepted: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
155 |
val forkedN: string val forked: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
156 |
val joinedN: string val joined: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
157 |
val runningN: string val running: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
158 |
val finishedN: string val finished: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
159 |
val failedN: string val failed: T |
50914
fe4714886d92
identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents:
50845
diff
changeset
|
160 |
val exec_idN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
161 |
val initN: string |
61209 | 162 |
val statusN: string val status: T |
163 |
val resultN: string val result: T |
|
164 |
val writelnN: string val writeln: T |
|
165 |
val stateN: string val state: T |
|
166 |
val informationN: string val information: T |
|
167 |
val tracingN: string val tracing: T |
|
168 |
val warningN: string val warning: T |
|
169 |
val legacyN: string val legacy: T |
|
170 |
val errorN: string val error: T |
|
171 |
val systemN: string val system: T |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
172 |
val protocolN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
173 |
val reportN: string val report: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
174 |
val no_reportN: string val no_report: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
175 |
val badN: string val bad: T |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
176 |
val intensifyN: string val intensify: T |
50715
8cfd585b9162
prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents:
50683
diff
changeset
|
177 |
val browserN: string |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
178 |
val graphviewN: string |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
179 |
val sendbackN: string |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
180 |
val paddingN: string |
50842 | 181 |
val padding_line: Properties.entry |
52697
6fb98a20c349
explicit padding on command boundary for "auto" generated sendback -- do not replace the corresponding goal command, but append to it;
wenzelm
parents:
52643
diff
changeset
|
182 |
val padding_command: Properties.entry |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
183 |
val dialogN: string val dialog: serial -> string -> T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
184 |
val functionN: string |
52563 | 185 |
val assign_update: Properties.T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
186 |
val removed_versions: Properties.T |
52111
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents:
51990
diff
changeset
|
187 |
val protocol_handler: string -> Properties.T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
188 |
val invoke_scala: string -> string -> Properties.T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
189 |
val cancel_scala: string -> Properties.T |
50842 | 190 |
val ML_statistics: Properties.entry |
50975 | 191 |
val task_statistics: Properties.entry |
51216 | 192 |
val command_timing: Properties.entry |
50845 | 193 |
val loading_theory: string -> Properties.T |
194 |
val dest_loading_theory: Properties.T -> string option |
|
59369
7090199d3f78
more informative build_theories_result: cumulative Runtime.exn_message;
wenzelm
parents:
59364
diff
changeset
|
195 |
val build_theories_result: string -> Properties.T |
56864 | 196 |
val print_operationsN: string |
197 |
val print_operations: Properties.T |
|
60842 | 198 |
val debugger_state: string -> Properties.T |
60834 | 199 |
val debugger_output: string -> Properties.T |
57594
037f3b251df5
regular message to refer to Simplifier Trace panel (unused);
wenzelm
parents:
56864
diff
changeset
|
200 |
val simp_trace_panelN: string |
55553
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
201 |
val simp_trace_logN: string |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
202 |
val simp_trace_stepN: string |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
203 |
val simp_trace_recurseN: string |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
204 |
val simp_trace_hintN: string |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
205 |
val simp_trace_ignoreN: string |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
206 |
val simp_trace_cancel: serial -> Properties.T |
40131
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents:
39585
diff
changeset
|
207 |
val no_output: Output.output * Output.output |
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents:
39585
diff
changeset
|
208 |
val default_output: T -> Output.output * Output.output |
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents:
39585
diff
changeset
|
209 |
val add_mode: string -> (T -> Output.output * Output.output) -> unit |
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents:
39585
diff
changeset
|
210 |
val output: T -> Output.output * Output.output |
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents:
39585
diff
changeset
|
211 |
val enclose: T -> Output.output -> Output.output |
25552 | 212 |
val markup: T -> string -> string |
59125 | 213 |
val markups: T list -> string -> string |
43665 | 214 |
val markup_only: T -> string |
55956
94d384d621b0
reject internal term names outright, and complete consts instead;
wenzelm
parents:
55919
diff
changeset
|
215 |
val markup_report: string -> string |
23623 | 216 |
end; |
217 |
||
218 |
structure Markup: MARKUP = |
|
219 |
struct |
|
220 |
||
30221 | 221 |
(** markup elements **) |
222 |
||
51988 | 223 |
(* misc values *) |
51951
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
224 |
|
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
225 |
fun parse_bool "true" = true |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
226 |
| parse_bool "false" = false |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
227 |
| parse_bool s = raise Fail ("Bad boolean: " ^ quote s); |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
228 |
|
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
229 |
val print_bool = Bool.toString; |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
230 |
|
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
231 |
fun parse_int s = |
43797
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
232 |
let val i = Int.fromString s in |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
233 |
if is_none i orelse String.isPrefix "~" s |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
234 |
then raise Fail ("Bad integer: " ^ quote s) |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
235 |
else the i |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
236 |
end; |
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
237 |
|
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
238 |
val print_int = signed_string_of_int; |
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
239 |
|
51988 | 240 |
fun parse_real s = |
241 |
(case Real.fromString s of |
|
242 |
SOME x => x |
|
243 |
| NONE => raise Fail ("Bad real: " ^ quote s)); |
|
244 |
||
51990 | 245 |
fun print_real x = |
246 |
let val s = signed_string_of_real x in |
|
247 |
(case space_explode "." s of |
|
248 |
[a, b] => if forall_string (fn c => c = "0") b then a else s |
|
249 |
| _ => s) |
|
250 |
end; |
|
51988 | 251 |
|
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
252 |
|
23658 | 253 |
(* basic markup *) |
23623 | 254 |
|
28017 | 255 |
type T = string * Properties.T; |
23637 | 256 |
|
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
257 |
val empty = ("", []); |
23637 | 258 |
|
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
259 |
fun is_empty ("", _) = true |
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
260 |
| is_empty _ = false; |
27883 | 261 |
|
23794 | 262 |
|
23671 | 263 |
fun properties more_props ((elem, props): T) = |
28017 | 264 |
(elem, fold_rev Properties.put more_props props); |
23671 | 265 |
|
55551 | 266 |
fun markup_elem name = (name, (name, []): T); |
267 |
fun markup_string name prop = (name, fn s => (name, [(prop, s)]): T); |
|
268 |
fun markup_int name prop = (name, fn i => (name, [(prop, print_int i)]): T); |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
269 |
|
26977 | 270 |
|
38721
ca8b14fa0d0d
added some proof state markup, notably number of subgoals (e.g. for indentation);
wenzelm
parents:
38474
diff
changeset
|
271 |
(* misc properties *) |
26977 | 272 |
|
23658 | 273 |
val nameN = "name"; |
27818 | 274 |
fun name a = properties [(nameN, a)]; |
275 |
||
23658 | 276 |
val kindN = "kind"; |
23671 | 277 |
|
60744 | 278 |
val serialN = "serial"; |
279 |
fun serial_properties i = [(serialN, print_int i)]; |
|
280 |
||
52854
92932931bd82
more general Output.result: allow to update arbitrary properties;
wenzelm
parents:
52800
diff
changeset
|
281 |
val instanceN = "instance"; |
92932931bd82
more general Output.result: allow to update arbitrary properties;
wenzelm
parents:
52800
diff
changeset
|
282 |
|
23658 | 283 |
|
55550 | 284 |
(* embedded languages *) |
285 |
||
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
286 |
val languageN = "language"; |
55615
bf4bbe72f740
completion of keywords and symbols based on language context;
wenzelm
parents:
55613
diff
changeset
|
287 |
val symbolsN = "symbols"; |
55666 | 288 |
val antiquotesN = "antiquotes"; |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
289 |
val delimitedN = "delimited" |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
290 |
|
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
291 |
fun is_delimited props = |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
292 |
Properties.get props delimitedN = SOME "true"; |
55666 | 293 |
|
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
294 |
fun language {name, symbols, antiquotes, delimited} = |
55666 | 295 |
(languageN, |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
296 |
[(nameN, name), |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
297 |
(symbolsN, print_bool symbols), |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
298 |
(antiquotesN, print_bool antiquotes), |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
299 |
(delimitedN, print_bool delimited)]); |
55550 | 300 |
|
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
301 |
fun language' {name, symbols, antiquotes} delimited = |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
302 |
language {name = name, symbols = symbols, antiquotes = antiquotes, delimited = delimited}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
303 |
|
61614 | 304 |
val language_outer = language' {name = "", symbols = true, antiquotes = false}; |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
305 |
val language_method = |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
306 |
language {name = "method", symbols = true, antiquotes = false, delimited = false}; |
56033 | 307 |
val language_attribute = |
308 |
language {name = "attribute", symbols = true, antiquotes = false, delimited = false}; |
|
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
309 |
val language_sort = language' {name = "sort", symbols = true, antiquotes = false}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
310 |
val language_type = language' {name = "type", symbols = true, antiquotes = false}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
311 |
val language_term = language' {name = "term", symbols = true, antiquotes = false}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
312 |
val language_prop = language' {name = "prop", symbols = true, antiquotes = false}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
313 |
val language_ML = language' {name = "ML", symbols = false, antiquotes = true}; |
56278
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents:
56202
diff
changeset
|
314 |
val language_SML = language' {name = "SML", symbols = false, antiquotes = false}; |
61600
1ca11ddfcc70
clarified completion of explicit symbols (see also f6bd97a587b7, e0e4ac981cf1);
wenzelm
parents:
61598
diff
changeset
|
315 |
val language_document = language' {name = "document", symbols = false, antiquotes = true}; |
55828
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
316 |
val language_antiquotation = |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
317 |
language {name = "antiquotation", symbols = true, antiquotes = false, delimited = true}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
318 |
val language_text = language' {name = "text", symbols = true, antiquotes = false}; |
42ac3cfb89f6
clarified language markup: added "delimited" property;
wenzelm
parents:
55763
diff
changeset
|
319 |
val language_rail = language {name = "rail", symbols = true, antiquotes = true, delimited = true}; |
56034
1c59b555ac4a
some Markup.language_path to prevent completion of symbols (notably "~") -- always "delimited" for simplicity in contrast to 42ac3cfb89f6;
wenzelm
parents:
56033
diff
changeset
|
320 |
val language_path = language {name = "path", symbols = false, antiquotes = false, delimited = true}; |
55550 | 321 |
|
322 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
323 |
(* formal entities *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
324 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
325 |
val (bindingN, binding) = markup_elem "binding"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
326 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
327 |
val entityN = "entity"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
328 |
fun entity kind name = (entityN, [(nameN, name), (kindN, kind)]); |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
329 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
330 |
fun get_entity_kind (name, props) = |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
331 |
if name = entityN then AList.lookup (op =) props kindN |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
332 |
else NONE; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
333 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
334 |
val defN = "def"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
335 |
val refN = "ref"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
336 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
337 |
|
55672
5e25cc741ab9
support for completion within the formal context;
wenzelm
parents:
55666
diff
changeset
|
338 |
(* completion *) |
5e25cc741ab9
support for completion within the formal context;
wenzelm
parents:
55666
diff
changeset
|
339 |
|
55694
a1184dfb8e00
clarified semantic completion: retain kind.full_name as official item name for history;
wenzelm
parents:
55687
diff
changeset
|
340 |
val (completionN, completion) = markup_elem "completion"; |
55914
c5b752d549e3
clarified init_assignable: make double-sure that initial values are reset;
wenzelm
parents:
55837
diff
changeset
|
341 |
val (no_completionN, no_completion) = markup_elem "no_completion"; |
55672
5e25cc741ab9
support for completion within the formal context;
wenzelm
parents:
55666
diff
changeset
|
342 |
|
5e25cc741ab9
support for completion within the formal context;
wenzelm
parents:
55666
diff
changeset
|
343 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
344 |
(* position *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
345 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
346 |
val lineN = "line"; |
58978
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents:
58855
diff
changeset
|
347 |
val end_lineN = "end_line"; |
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents:
58855
diff
changeset
|
348 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
349 |
val offsetN = "offset"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
350 |
val end_offsetN = "end_offset"; |
58978
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents:
58855
diff
changeset
|
351 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
352 |
val fileN = "file"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
353 |
val idN = "id"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
354 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
355 |
val position_properties' = [fileN, idN]; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
356 |
val position_properties = [lineN, offsetN, end_offsetN] @ position_properties'; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
357 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
358 |
val (positionN, position) = markup_elem "position"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
359 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
360 |
|
58464 | 361 |
(* expression *) |
362 |
||
363 |
val (expressionN, expression) = markup_elem "expression"; |
|
364 |
||
365 |
||
58544
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents:
58464
diff
changeset
|
366 |
(* citation *) |
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents:
58464
diff
changeset
|
367 |
|
58545
30b75b7958d6
citation tooltip/hyperlink based on open buffers with .bib files;
wenzelm
parents:
58544
diff
changeset
|
368 |
val (citationN, citation) = markup_string "citation" nameN; |
58544
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents:
58464
diff
changeset
|
369 |
|
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents:
58464
diff
changeset
|
370 |
|
54702
3daeba5130f0
added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents:
53378
diff
changeset
|
371 |
(* external resources *) |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
372 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
373 |
val (pathN, path) = markup_string "path" nameN; |
54702
3daeba5130f0
added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents:
53378
diff
changeset
|
374 |
val (urlN, url) = markup_string "url" nameN; |
61660
78b371644654
added antiquotation @{doc}, e.g. useful for demonstration purposes;
wenzelm
parents:
61614
diff
changeset
|
375 |
val (docN, doc) = markup_string "doc" nameN; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
376 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
377 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
378 |
(* pretty printing *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
379 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
380 |
val indentN = "indent"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
381 |
val (blockN, block) = markup_int "block" indentN; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
382 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
383 |
val widthN = "width"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
384 |
val (breakN, break) = markup_int "break" widthN; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
385 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
386 |
val (fbreakN, fbreak) = markup_elem "fbreak"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
387 |
|
51570
3633828d80fc
basic support for Pretty.item, which is considered as logical markup and interpreted in Isabelle/Scala, but ignored elsewhere (TTY, latex etc.);
wenzelm
parents:
51228
diff
changeset
|
388 |
val (itemN, item) = markup_elem "item"; |
3633828d80fc
basic support for Pretty.item, which is considered as logical markup and interpreted in Isabelle/Scala, but ignored elsewhere (TTY, latex etc.);
wenzelm
parents:
51228
diff
changeset
|
389 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
390 |
|
56548 | 391 |
(* text properties *) |
392 |
||
393 |
val (wordsN, words) = markup_elem "words"; |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
394 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
395 |
val (hiddenN, hidden) = markup_elem "hidden"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
396 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
397 |
|
58048
aa6296d09e0e
more explicit Method.modifier with reported position;
wenzelm
parents:
57975
diff
changeset
|
398 |
(* misc entities *) |
56465 | 399 |
|
400 |
val system_optionN = "system_option"; |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
401 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
402 |
val theoryN = "theory"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
403 |
val classN = "class"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
404 |
val type_nameN = "type_name"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
405 |
val constantN = "constant"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
406 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
407 |
val (fixedN, fixed) = markup_string "fixed" nameN; |
53378
07990ba8c0ea
cases: more position information and PIDE markup;
wenzelm
parents:
53055
diff
changeset
|
408 |
val (caseN, case_) = markup_string "case" nameN; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
409 |
val (dynamic_factN, dynamic_fact) = markup_string "dynamic_fact" nameN; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
410 |
|
58048
aa6296d09e0e
more explicit Method.modifier with reported position;
wenzelm
parents:
57975
diff
changeset
|
411 |
val method_modifierN = "method_modifier"; |
aa6296d09e0e
more explicit Method.modifier with reported position;
wenzelm
parents:
57975
diff
changeset
|
412 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
413 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
414 |
(* inner syntax *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
415 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
416 |
val (tfreeN, tfree) = markup_elem "tfree"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
417 |
val (tvarN, tvar) = markup_elem "tvar"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
418 |
val (freeN, free) = markup_elem "free"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
419 |
val (skolemN, skolem) = markup_elem "skolem"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
420 |
val (boundN, bound) = markup_elem "bound"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
421 |
val (varN, var) = markup_elem "var"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
422 |
val (numeralN, numeral) = markup_elem "numeral"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
423 |
val (literalN, literal) = markup_elem "literal"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
424 |
val (delimiterN, delimiter) = markup_elem "delimiter"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
425 |
val (inner_stringN, inner_string) = markup_elem "inner_string"; |
55033 | 426 |
val (inner_cartoucheN, inner_cartouche) = markup_elem "inner_cartouche"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
427 |
val (inner_commentN, inner_comment) = markup_elem "inner_comment"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
428 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
429 |
val (token_rangeN, token_range) = markup_elem "token_range"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
430 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
431 |
val (sortingN, sorting) = markup_elem "sorting"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
432 |
val (typingN, typing) = markup_elem "typing"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
433 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
434 |
|
60744 | 435 |
(* ML *) |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
436 |
|
55505 | 437 |
val (ML_keyword1N, ML_keyword1) = markup_elem "ML_keyword1"; |
438 |
val (ML_keyword2N, ML_keyword2) = markup_elem "ML_keyword2"; |
|
439 |
val (ML_keyword3N, ML_keyword3) = markup_elem "ML_keyword3"; |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
440 |
val (ML_delimiterN, ML_delimiter) = markup_elem "ML_delimiter"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
441 |
val (ML_tvarN, ML_tvar) = markup_elem "ML_tvar"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
442 |
val (ML_numeralN, ML_numeral) = markup_elem "ML_numeral"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
443 |
val (ML_charN, ML_char) = markup_elem "ML_char"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
444 |
val (ML_stringN, ML_string) = markup_elem "ML_string"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
445 |
val (ML_commentN, ML_comment) = markup_elem "ML_comment"; |
56278
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents:
56202
diff
changeset
|
446 |
val (SML_stringN, SML_string) = markup_elem "SML_string"; |
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents:
56202
diff
changeset
|
447 |
val (SML_commentN, SML_comment) = markup_elem "SML_comment"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
448 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
449 |
val ML_defN = "ML_def"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
450 |
val ML_openN = "ML_open"; |
55837 | 451 |
val ML_structureN = "ML_structure"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
452 |
val (ML_typingN, ML_typing) = markup_elem "ML_typing"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
453 |
|
60744 | 454 |
val (ML_breakpointN, ML_breakpoint) = markup_int "ML_breakpoint" serialN; |
455 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
456 |
|
55550 | 457 |
(* antiquotations *) |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
458 |
|
55526 | 459 |
val (antiquotedN, antiquoted) = markup_elem "antiquoted"; |
460 |
val (antiquoteN, antiquote) = markup_elem "antiquote"; |
|
461 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
462 |
val ML_antiquotationN = "ML_antiquotation"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
463 |
val document_antiquotationN = "document_antiquotation"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
464 |
val document_antiquotation_optionN = "document_antiquotation_option"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
465 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
466 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
467 |
(* text structure *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
468 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
469 |
val (paragraphN, paragraph) = markup_elem "paragraph"; |
50545
00bdc48c5f71
explicit text_fold markup, which is used by default in Pretty.chunks/chunks2;
wenzelm
parents:
50543
diff
changeset
|
470 |
val (text_foldN, text_fold) = markup_elem "text_fold"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
471 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
472 |
|
61449 | 473 |
(* Markdown document structure *) |
474 |
||
475 |
val (markdown_paragraphN, markdown_paragraph) = markup_elem "markdown_paragraph"; |
|
476 |
val (markdown_listN, markdown_list) = markup_string "markdown_list" kindN; |
|
477 |
val (markdown_itemN, markdown_item) = markup_int "markdown_item" "depth"; |
|
478 |
||
479 |
||
59795 | 480 |
(* formal input *) |
481 |
||
482 |
val inputN = "input"; |
|
483 |
fun input delimited props = (inputN, (delimitedN, print_bool delimited) :: props); |
|
484 |
||
485 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
486 |
(* outer syntax *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
487 |
|
59935 | 488 |
val (command_keywordN, command_keyword) = markup_elem "command_keyword"; |
55750
baa7a1e57f4a
back to Markup.command for actual tokens (amending 4a4e5686e091) -- avoid conflict of jEdit token marker with Rendering.text_colors;
wenzelm
parents:
55744
diff
changeset
|
489 |
val (commandN, command) = markup_elem "command"; |
55744
4a4e5686e091
clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
wenzelm
parents:
55694
diff
changeset
|
490 |
val (keyword1N, keyword1) = markup_elem "keyword1"; |
4a4e5686e091
clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
wenzelm
parents:
55694
diff
changeset
|
491 |
val (keyword2N, keyword2) = markup_elem "keyword2"; |
55763 | 492 |
val (keyword3N, keyword3) = markup_elem "keyword3"; |
55919
2eb8c13339a5
more explicit quasi_keyword markup, for Args.$$$ material, which is somewhere in between of outer and inner syntax;
wenzelm
parents:
55914
diff
changeset
|
493 |
val (quasi_keywordN, quasi_keyword) = markup_elem "quasi_keyword"; |
56202 | 494 |
val (improperN, improper) = markup_elem "improper"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
495 |
val (operatorN, operator) = markup_elem "operator"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
496 |
val (stringN, string) = markup_elem "string"; |
59081 | 497 |
val (alt_stringN, alt_string) = markup_elem "alt_string"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
498 |
val (verbatimN, verbatim) = markup_elem "verbatim"; |
55033 | 499 |
val (cartoucheN, cartouche) = markup_elem "cartouche"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
500 |
val (commentN, comment) = markup_elem "comment"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
501 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
502 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
503 |
(* timing *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
504 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
505 |
val elapsedN = "elapsed"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
506 |
val cpuN = "cpu"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
507 |
val gcN = "gc"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
508 |
|
50781 | 509 |
fun timing_properties {elapsed, cpu, gc} = |
510 |
[(elapsedN, Time.toString elapsed), |
|
511 |
(cpuN, Time.toString cpu), |
|
512 |
(gcN, Time.toString gc)]; |
|
513 |
||
51665 | 514 |
fun parse_timing_properties props = |
515 |
{elapsed = Properties.seconds props elapsedN, |
|
516 |
cpu = Properties.seconds props cpuN, |
|
517 |
gc = Properties.seconds props gcN}; |
|
51218
6425a0d3b7ac
support for build passing timings from Scala to ML;
wenzelm
parents:
51217
diff
changeset
|
518 |
|
51665 | 519 |
val timingN = "timing"; |
520 |
fun timing t = (timingN, timing_properties t); |
|
51218
6425a0d3b7ac
support for build passing timings from Scala to ML;
wenzelm
parents:
51217
diff
changeset
|
521 |
|
51228 | 522 |
|
523 |
(* command timing *) |
|
524 |
||
525 |
val command_timingN = "command_timing"; |
|
526 |
||
527 |
fun command_timing_properties {file, offset, name} elapsed = |
|
528 |
[(fileN, file), (offsetN, print_int offset), |
|
529 |
(nameN, name), (elapsedN, Time.toString elapsed)]; |
|
530 |
||
531 |
fun parse_command_timing_properties props = |
|
532 |
(case (Properties.get props fileN, Properties.get props offsetN, Properties.get props nameN) of |
|
533 |
(SOME file, SOME offset, SOME name) => |
|
51665 | 534 |
SOME ({file = file, offset = parse_int offset, name = name}, |
535 |
Properties.seconds props elapsedN) |
|
51228 | 536 |
| _ => NONE); |
537 |
||
538 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
539 |
(* toplevel *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
540 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
541 |
val subgoalsN = "subgoals"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
542 |
val (proof_stateN, proof_state) = markup_int "proof_state" subgoalsN; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
543 |
|
50543 | 544 |
val (goalN, goal) = markup_elem "goal"; |
50537
08ce81aeeacc
more subgoal markup information, which is potentially useful to manage proof state output;
wenzelm
parents:
50503
diff
changeset
|
545 |
val (subgoalN, subgoal) = markup_string "subgoal" nameN; |
50215 | 546 |
|
50450
358b6020f8b6
generalized notion of active area, where sendback is just one application;
wenzelm
parents:
50255
diff
changeset
|
547 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
548 |
(* command status *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
549 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
550 |
val taskN = "task"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
551 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
552 |
val (acceptedN, accepted) = markup_elem "accepted"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
553 |
val (forkedN, forked) = markup_elem "forked"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
554 |
val (joinedN, joined) = markup_elem "joined"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
555 |
val (runningN, running) = markup_elem "running"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
556 |
val (finishedN, finished) = markup_elem "finished"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
557 |
val (failedN, failed) = markup_elem "failed"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
558 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
559 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
560 |
(* messages *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
561 |
|
50914
fe4714886d92
identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents:
50845
diff
changeset
|
562 |
val exec_idN = "exec_id"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
563 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
564 |
val initN = "init"; |
61209 | 565 |
val (statusN, status) = markup_elem "status"; |
566 |
val (resultN, result) = markup_elem "result"; |
|
567 |
val (writelnN, writeln) = markup_elem "writeln"; |
|
568 |
val (stateN, state) = markup_elem "state" |
|
569 |
val (informationN, information) = markup_elem "information"; |
|
570 |
val (tracingN, tracing) = markup_elem "tracing"; |
|
571 |
val (warningN, warning) = markup_elem "warning"; |
|
572 |
val (legacyN, legacy) = markup_elem "legacy"; |
|
573 |
val (errorN, error) = markup_elem "error"; |
|
574 |
val (systemN, system) = markup_elem "system"; |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
575 |
val protocolN = "protocol"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
576 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
577 |
val (reportN, report) = markup_elem "report"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
578 |
val (no_reportN, no_report) = markup_elem "no_report"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
579 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
580 |
val (badN, bad) = markup_elem "bad"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
581 |
|
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
582 |
val (intensifyN, intensify) = markup_elem "intensify"; |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
583 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
584 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
585 |
(* active areas *) |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
586 |
|
50715
8cfd585b9162
prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents:
50683
diff
changeset
|
587 |
val browserN = "browser" |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
588 |
val graphviewN = "graphview"; |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
589 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
590 |
val sendbackN = "sendback"; |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
591 |
val paddingN = "padding"; |
52697
6fb98a20c349
explicit padding on command boundary for "auto" generated sendback -- do not replace the corresponding goal command, but append to it;
wenzelm
parents:
52643
diff
changeset
|
592 |
val padding_line = (paddingN, "line"); |
6fb98a20c349
explicit padding on command boundary for "auto" generated sendback -- do not replace the corresponding goal command, but append to it;
wenzelm
parents:
52643
diff
changeset
|
593 |
val padding_command = (paddingN, "command"); |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
594 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
595 |
val dialogN = "dialog"; |
50503
50f141b34bb7
enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents:
50500
diff
changeset
|
596 |
fun dialog i result = (dialogN, [(serialN, print_int i), (resultN, result)]); |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
597 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
598 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
599 |
(* protocol message functions *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
600 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
601 |
val functionN = "function" |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
602 |
|
52563 | 603 |
val assign_update = [(functionN, "assign_update")]; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
604 |
val removed_versions = [(functionN, "removed_versions")]; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
605 |
|
52111
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents:
51990
diff
changeset
|
606 |
fun protocol_handler name = [(functionN, "protocol_handler"), (nameN, name)]; |
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents:
51990
diff
changeset
|
607 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
608 |
fun invoke_scala name id = [(functionN, "invoke_scala"), (nameN, name), (idN, id)]; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
609 |
fun cancel_scala id = [(functionN, "cancel_scala"), (idN, id)]; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
610 |
|
50683 | 611 |
val ML_statistics = (functionN, "ML_statistics"); |
50255 | 612 |
|
50975 | 613 |
val task_statistics = (functionN, "task_statistics"); |
614 |
||
51216 | 615 |
val command_timing = (functionN, "command_timing"); |
616 |
||
50845 | 617 |
fun loading_theory name = [("function", "loading_theory"), ("name", name)]; |
618 |
||
619 |
fun dest_loading_theory [("function", "loading_theory"), ("name", name)] = SOME name |
|
620 |
| dest_loading_theory _ = NONE; |
|
621 |
||
59369
7090199d3f78
more informative build_theories_result: cumulative Runtime.exn_message;
wenzelm
parents:
59364
diff
changeset
|
622 |
fun build_theories_result id = [("function", "build_theories_result"), ("id", id)]; |
56616
abc2da18d08d
added protocol command "use_theories", with core functionality of batch build;
wenzelm
parents:
56548
diff
changeset
|
623 |
|
56864 | 624 |
val print_operationsN = "print_operations"; |
625 |
val print_operations = [(functionN, print_operationsN)]; |
|
626 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
627 |
|
60830 | 628 |
(* debugger *) |
629 |
||
60842 | 630 |
fun debugger_state name = [(functionN, "debugger_state"), (nameN, name)]; |
60834 | 631 |
fun debugger_output name = [(functionN, "debugger_output"), (nameN, name)]; |
60830 | 632 |
|
633 |
||
55553
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
634 |
(* simplifier trace *) |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
635 |
|
57594
037f3b251df5
regular message to refer to Simplifier Trace panel (unused);
wenzelm
parents:
56864
diff
changeset
|
636 |
val simp_trace_panelN = "simp_trace_panel"; |
037f3b251df5
regular message to refer to Simplifier Trace panel (unused);
wenzelm
parents:
56864
diff
changeset
|
637 |
|
55553
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
638 |
val simp_trace_logN = "simp_trace_log"; |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
639 |
val simp_trace_stepN = "simp_trace_step"; |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
640 |
val simp_trace_recurseN = "simp_trace_recurse"; |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
641 |
val simp_trace_hintN = "simp_trace_hint"; |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
642 |
val simp_trace_ignoreN = "simp_trace_ignore"; |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
643 |
|
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
644 |
fun simp_trace_cancel i = [(functionN, "simp_trace_cancel"), (serialN, print_int i)]; |
99409ccbe04a
more standard names for protocol and markup elements;
wenzelm
parents:
55551
diff
changeset
|
645 |
|
27969 | 646 |
|
55672
5e25cc741ab9
support for completion within the formal context;
wenzelm
parents:
55666
diff
changeset
|
647 |
|
30221 | 648 |
(** print mode operations **) |
23704 | 649 |
|
29325 | 650 |
val no_output = ("", ""); |
651 |
fun default_output (_: T) = no_output; |
|
23704 | 652 |
|
653 |
local |
|
654 |
val default = {output = default_output}; |
|
43684 | 655 |
val modes = Synchronized.var "Markup.modes" (Symtab.make [("", default)]); |
23704 | 656 |
in |
43684 | 657 |
fun add_mode name output = |
46894
e2ad717ec889
allow redefining pretty/markup modes (not output due to bootstrap issues) -- to support reloading of theory src/HOL/src/Tools/Code_Generator;
wenzelm
parents:
45674
diff
changeset
|
658 |
Synchronized.change modes (fn tab => |
e2ad717ec889
allow redefining pretty/markup modes (not output due to bootstrap issues) -- to support reloading of theory src/HOL/src/Tools/Code_Generator;
wenzelm
parents:
45674
diff
changeset
|
659 |
(if not (Symtab.defined tab name) then () |
61209 | 660 |
else Output.warning ("Redefining markup mode " ^ quote name); |
46894
e2ad717ec889
allow redefining pretty/markup modes (not output due to bootstrap issues) -- to support reloading of theory src/HOL/src/Tools/Code_Generator;
wenzelm
parents:
45674
diff
changeset
|
661 |
Symtab.update (name, {output = output}) tab)); |
23704 | 662 |
fun get_mode () = |
43684 | 663 |
the_default default |
664 |
(Library.get_first (Symtab.lookup (Synchronized.value modes)) (print_mode_value ())); |
|
23623 | 665 |
end; |
23704 | 666 |
|
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
667 |
fun output m = if is_empty m then no_output else #output (get_mode ()) m; |
23704 | 668 |
|
23719 | 669 |
val enclose = output #-> Library.enclose; |
670 |
||
25552 | 671 |
fun markup m = |
672 |
let val (bg, en) = output m |
|
673 |
in Library.enclose (Output.escape bg) (Output.escape en) end; |
|
674 |
||
59125 | 675 |
val markups = fold_rev markup; |
676 |
||
43665 | 677 |
fun markup_only m = markup m ""; |
678 |
||
55956
94d384d621b0
reject internal term names outright, and complete consts instead;
wenzelm
parents:
55919
diff
changeset
|
679 |
fun markup_report "" = "" |
94d384d621b0
reject internal term names outright, and complete consts instead;
wenzelm
parents:
55919
diff
changeset
|
680 |
| markup_report txt = markup report txt; |
94d384d621b0
reject internal term names outright, and complete consts instead;
wenzelm
parents:
55919
diff
changeset
|
681 |
|
23704 | 682 |
end; |