| author | nipkow | 
| Thu, 04 Oct 2018 11:18:39 +0200 | |
| changeset 69118 | 12dce58bcd3f | 
| parent 68997 | 4278947ba336 | 
| child 69211 | 7062639cfdaa | 
| 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 | |
| 28017 | 9 | type T = string * Properties.T | 
| 38474 
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
 wenzelm parents: 
38429diff
changeset | 10 | val empty: T | 
| 
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
 wenzelm parents: 
38429diff
changeset | 11 | val is_empty: T -> bool | 
| 38229 | 12 | val properties: Properties.T -> T -> T | 
| 68997 | 13 | val nameN: string val name: string -> T -> T | 
| 14 | val xnameN: string val xname: 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: 
38871diff
changeset | 15 | val kindN: string | 
| 60744 | 16 | val serialN: string | 
| 17 | val serial_properties: int -> Properties.T | |
| 52854 
92932931bd82
more general Output.result: allow to update arbitrary properties;
 wenzelm parents: 
52800diff
changeset | 18 | val instanceN: string | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 19 | val languageN: string | 
| 55615 
bf4bbe72f740
completion of keywords and symbols based on language context;
 wenzelm parents: 
55613diff
changeset | 20 | val symbolsN: string | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 21 | val delimitedN: string | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 22 | val is_delimited: Properties.T -> bool | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 23 |   val language: {name: string, symbols: bool, antiquotes: bool, delimited: bool} -> T
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 24 |   val language': {name: string, symbols: bool, antiquotes: bool} -> bool -> T
 | 
| 62231 
25f4a9cd8b68
tuned markup, e.g. relevant for Rendering.tooltip;
 wenzelm parents: 
61864diff
changeset | 25 | val language_Isar: bool -> T | 
| 55761 
213b9811f59f
method language markup, e.g. relevant to prevent outer keyword completion;
 wenzelm parents: 
55750diff
changeset | 26 | val language_method: T | 
| 56033 | 27 | val language_attribute: T | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 28 | val language_sort: bool -> T | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 29 | val language_type: bool -> T | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 30 | val language_term: bool -> T | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 31 | val language_prop: bool -> T | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 32 | val language_ML: bool -> T | 
| 56278 
2576d3a40ed6
separate tokenization and language context for SML: no symbols, no antiquotes;
 wenzelm parents: 
56202diff
changeset | 33 | val language_SML: bool -> T | 
| 61600 
1ca11ddfcc70
clarified completion of explicit symbols (see also f6bd97a587b7, e0e4ac981cf1);
 wenzelm parents: 
61598diff
changeset | 34 | val language_document: bool -> T | 
| 55653 
528de9a20054
more markup -- complete symbols within antiquotation, notably with broken arguments;
 wenzelm parents: 
55615diff
changeset | 35 | val language_antiquotation: T | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 36 | val language_text: bool -> T | 
| 62520 | 37 | val language_verbatim: bool -> T | 
| 67429 | 38 | val language_latex: bool -> T | 
| 55613 | 39 | 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: 
56033diff
changeset | 40 | val language_path: T | 
| 62772 | 41 | val language_mixfix: T | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 42 | val bindingN: string val binding: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 43 | 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: 
46894diff
changeset | 44 | val get_entity_kind: T -> string option | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 45 | val defN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 46 | val refN: string | 
| 55694 
a1184dfb8e00
clarified semantic completion: retain kind.full_name as official item name for history;
 wenzelm parents: 
55687diff
changeset | 47 | val completionN: string val completion: T | 
| 55914 
c5b752d549e3
clarified init_assignable: make double-sure that initial values are reset;
 wenzelm parents: 
55837diff
changeset | 48 | 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: 
46894diff
changeset | 49 | val lineN: string | 
| 58978 
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
 wenzelm parents: 
58855diff
changeset | 50 | val end_lineN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 51 | val offsetN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 52 | val end_offsetN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 53 | val fileN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 54 | val idN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 55 | val position_properties': string list | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 56 | val position_properties: string list | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 57 | val positionN: string val position: T | 
| 62806 | 58 | val expressionN: string val expression: string -> T | 
| 58545 
30b75b7958d6
citation tooltip/hyperlink based on open buffers with .bib files;
 wenzelm parents: 
58544diff
changeset | 59 | 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: 
46894diff
changeset | 60 | val pathN: string val path: string -> T | 
| 54702 
3daeba5130f0
added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
 wenzelm parents: 
53378diff
changeset | 61 | val urlN: string val url: string -> T | 
| 61660 
78b371644654
added antiquotation @{doc}, e.g. useful for demonstration purposes;
 wenzelm parents: 
61614diff
changeset | 62 | val docN: string val doc: string -> T | 
| 62788 | 63 | val markupN: string | 
| 64 | val consistentN: string | |
| 62789 | 65 | val unbreakableN: string | 
| 62786 | 66 | val block_properties: string list | 
| 62788 | 67 | val indentN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 68 | val widthN: string | 
| 61864 | 69 | val blockN: string val block: bool -> int -> T | 
| 61862 
e2a9e46ac0fb
support pretty break indent, like underlying ML systems;
 wenzelm parents: 
61660diff
changeset | 70 | val breakN: string val break: int -> int -> T | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 71 | 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: 
51228diff
changeset | 72 | val itemN: string val item: T | 
| 56548 | 73 | val wordsN: string val words: T | 
| 67506 
30233285270a
more markup: disable spell-checker for raw latex;
 wenzelm parents: 
67429diff
changeset | 74 | val no_wordsN: string val no_words: T | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 75 | val hiddenN: string val hidden: T | 
| 68298 
2c3ce27cf4a8
markup for deleted fragments of token source (NB: quoted tokens transform "\123" implicitly);
 wenzelm parents: 
68101diff
changeset | 76 | val deleteN: string val delete: T | 
| 56465 | 77 | val system_optionN: string | 
| 67219 | 78 | val sessionN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 79 | val theoryN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 80 | val classN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 81 | val type_nameN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 82 | val constantN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 83 | val fixedN: string val fixed: string -> T | 
| 53378 
07990ba8c0ea
cases: more position information and PIDE markup;
 wenzelm parents: 
53055diff
changeset | 84 | 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: 
46894diff
changeset | 85 | val dynamic_factN: string val dynamic_fact: string -> T | 
| 63337 | 86 | val literal_factN: string val literal_fact: string -> T | 
| 58048 
aa6296d09e0e
more explicit Method.modifier with reported position;
 wenzelm parents: 
57975diff
changeset | 87 | val method_modifierN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 88 | val tfreeN: string val tfree: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 89 | val tvarN: string val tvar: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 90 | val freeN: string val free: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 91 | val skolemN: string val skolem: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 92 | val boundN: string val bound: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 93 | val varN: string val var: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 94 | val numeralN: string val numeral: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 95 | val literalN: string val literal: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 96 | val delimiterN: string val delimiter: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 97 | val inner_stringN: string val inner_string: T | 
| 55033 | 98 | 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: 
46894diff
changeset | 99 | 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: 
46894diff
changeset | 100 | 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: 
46894diff
changeset | 101 | val sortingN: string val sorting: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 102 | val typingN: string val typing: T | 
| 63347 | 103 | val class_parameterN: string val class_parameter: T | 
| 55505 | 104 | val ML_keyword1N: string val ML_keyword1: T | 
| 105 | val ML_keyword2N: string val ML_keyword2: T | |
| 106 | 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: 
46894diff
changeset | 107 | 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: 
46894diff
changeset | 108 | 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: 
46894diff
changeset | 109 | 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: 
46894diff
changeset | 110 | 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: 
46894diff
changeset | 111 | 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: 
46894diff
changeset | 112 | val ML_commentN: string val ML_comment: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 113 | val ML_defN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 114 | val ML_openN: string | 
| 55837 | 115 | val ML_structureN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 116 | val ML_typingN: string val ML_typing: T | 
| 60744 | 117 | val ML_breakpointN: string val ML_breakpoint: int -> T | 
| 55526 | 118 | val antiquotedN: string val antiquoted: T | 
| 119 | val antiquoteN: string val antiquote: T | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 120 | val ML_antiquotationN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 121 | val document_antiquotationN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 122 | val document_antiquotation_optionN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 123 | val paragraphN: string val paragraph: T | 
| 50545 
00bdc48c5f71
explicit text_fold markup, which is used by default in Pretty.chunks/chunks2;
 wenzelm parents: 
50543diff
changeset | 124 | val text_foldN: string val text_fold: T | 
| 61449 | 125 | val markdown_paragraphN: string val markdown_paragraph: T | 
| 67323 
d02208cefbdb
PIDE markup for Markdown items (which may consist of multiple paragraphs or lists);
 wenzelm parents: 
67322diff
changeset | 126 | val markdown_itemN: string val markdown_item: T | 
| 67336 | 127 | val markdown_bulletN: string val markdown_bullet: int -> T | 
| 61449 | 128 | val markdown_listN: string val markdown_list: string -> T | 
| 67336 | 129 | val itemizeN: string | 
| 130 | val enumerateN: string | |
| 131 | val descriptionN: string | |
| 59795 | 132 | val inputN: string val input: bool -> Properties.T -> T | 
| 59935 | 133 | val command_keywordN: string val command_keyword: T | 
| 66066 | 134 | val commandN: string val command_properties: T -> T | 
| 135 | val keywordN: string val keyword_properties: T -> T | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 136 | val stringN: string val string: T | 
| 59081 | 137 | 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: 
46894diff
changeset | 138 | val verbatimN: string val verbatim: T | 
| 55033 | 139 | val cartoucheN: string val cartouche: T | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 140 | val commentN: string val comment: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 141 | val keyword1N: string val keyword1: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 142 | val keyword2N: string val keyword2: T | 
| 55763 | 143 | 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: 
55914diff
changeset | 144 | val quasi_keywordN: string val quasi_keyword: T | 
| 56202 | 145 | val improperN: string val improper: T | 
| 146 | val operatorN: string val operator: T | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 147 | val elapsedN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 148 | val cpuN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 149 | val gcN: string | 
| 51606 
2843cc095a57
additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
 wenzelm parents: 
51570diff
changeset | 150 |   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: 
51570diff
changeset | 151 |   val parse_timing_properties: Properties.T -> {elapsed: Time.time, cpu: Time.time, gc: Time.time}
 | 
| 51228 | 152 | val command_timingN: string | 
| 153 | val command_timing_properties: | |
| 154 |     {file: string, offset: int, name: string} -> Time.time -> Properties.T
 | |
| 155 | val parse_command_timing_properties: | |
| 156 |     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: 
51570diff
changeset | 157 |   val timingN: string val timing: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> T
 | 
| 63474 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 158 | val command_indentN: string val command_indent: int -> T | 
| 50543 | 159 | val goalN: string val goal: T | 
| 50537 
08ce81aeeacc
more subgoal markup information, which is potentially useful to manage proof state output;
 wenzelm parents: 
50503diff
changeset | 160 | 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: 
46894diff
changeset | 161 | val taskN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 162 | val acceptedN: string val accepted: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 163 | val forkedN: string val forked: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 164 | val joinedN: string val joined: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 165 | val runningN: string val running: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 166 | val finishedN: string val finished: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 167 | val failedN: string val failed: T | 
| 68871 
f5c76072db55
more explicit status for "canceled" command within theory node;
 wenzelm parents: 
68822diff
changeset | 168 | val canceledN: string val canceled: T | 
| 68323 | 169 | val initializedN: string val initialized: T | 
| 68884 
9b97d0b20d95
clarified quasi_consolidated state: ensure that exports are present for ok nodes;
 wenzelm parents: 
68871diff
changeset | 170 | val finalizedN: string val finalized: T | 
| 66379 
6392766f3c25
maintain "consolidated" status of theory nodes, which means all evals are finished (but not necessarily prints nor imports);
 wenzelm parents: 
66066diff
changeset | 171 | val consolidatedN: string val consolidated: T | 
| 50914 
fe4714886d92
identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
 wenzelm parents: 
50845diff
changeset | 172 | val exec_idN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 173 | val initN: string | 
| 61209 | 174 | val statusN: string val status: T | 
| 175 | val resultN: string val result: T | |
| 176 | val writelnN: string val writeln: T | |
| 177 | val stateN: string val state: T | |
| 178 | val informationN: string val information: T | |
| 179 | val tracingN: string val tracing: T | |
| 180 | val warningN: string val warning: T | |
| 181 | val legacyN: string val legacy: T | |
| 182 | val errorN: string val error: T | |
| 183 | val systemN: string val system: T | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 184 | val protocolN: string | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 185 | val reportN: string val report: T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 186 | val no_reportN: string val no_report: T | 
| 64677 
8dc24130e8fe
more uniform treatment of "bad" like other messages (with serial number);
 wenzelm parents: 
63806diff
changeset | 187 | val badN: string val bad: unit -> T | 
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 188 | val intensifyN: string val intensify: T | 
| 50715 
8cfd585b9162
prefer old graph browser in Isabelle/jEdit, which still produces better layout;
 wenzelm parents: 
50683diff
changeset | 189 | val browserN: string | 
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 190 | val graphviewN: string | 
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 191 | val sendbackN: string | 
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 192 | val paddingN: string | 
| 50842 | 193 | 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: 
52643diff
changeset | 194 | val padding_command: Properties.entry | 
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 195 | val dialogN: string val dialog: serial -> string -> T | 
| 63681 | 196 | val jedit_actionN: string | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 197 | val functionN: string | 
| 52563 | 198 | val assign_update: Properties.T | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 199 | val removed_versions: Properties.T | 
| 52111 
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
 wenzelm parents: 
51990diff
changeset | 200 | val protocol_handler: string -> Properties.T | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 201 | val invoke_scala: string -> string -> Properties.T | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 202 | val cancel_scala: string -> Properties.T | 
| 50842 | 203 | val ML_statistics: Properties.entry | 
| 50975 | 204 | val task_statistics: Properties.entry | 
| 51216 | 205 | val command_timing: Properties.entry | 
| 66873 
9953ae603a23
provide theory timing information, similar to command timing but always considered relevant;
 wenzelm parents: 
66379diff
changeset | 206 | val theory_timing: Properties.entry | 
| 68088 | 207 | val exportN: string | 
| 68101 | 208 | type export_args = | 
| 209 |     {id: string option, serial: serial, theory_name: string, name: string, compress: bool}
 | |
| 68089 | 210 | val export: export_args -> Properties.T | 
| 50845 | 211 | val loading_theory: string -> Properties.T | 
| 212 | val dest_loading_theory: Properties.T -> string option | |
| 65313 | 213 | val build_session_finished: Properties.T | 
| 56864 | 214 | val print_operationsN: string | 
| 215 | val print_operations: Properties.T | |
| 60842 | 216 | val debugger_state: string -> Properties.T | 
| 60834 | 217 | val debugger_output: string -> Properties.T | 
| 57594 
037f3b251df5
regular message to refer to Simplifier Trace panel (unused);
 wenzelm parents: 
56864diff
changeset | 218 | val simp_trace_panelN: string | 
| 55553 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 219 | val simp_trace_logN: string | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 220 | val simp_trace_stepN: string | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 221 | val simp_trace_recurseN: string | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 222 | val simp_trace_hintN: string | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 223 | val simp_trace_ignoreN: string | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 224 | val simp_trace_cancel: serial -> Properties.T | 
| 40131 
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
 wenzelm parents: 
39585diff
changeset | 225 | val no_output: Output.output * Output.output | 
| 
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
 wenzelm parents: 
39585diff
changeset | 226 | 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: 
39585diff
changeset | 227 | val output: T -> Output.output * Output.output | 
| 
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
 wenzelm parents: 
39585diff
changeset | 228 | val enclose: T -> Output.output -> Output.output | 
| 25552 | 229 | val markup: T -> string -> string | 
| 59125 | 230 | val markups: T list -> string -> string | 
| 43665 | 231 | val markup_only: T -> string | 
| 55956 
94d384d621b0
reject internal term names outright, and complete consts instead;
 wenzelm parents: 
55919diff
changeset | 232 | val markup_report: string -> string | 
| 23623 | 233 | end; | 
| 234 | ||
| 235 | structure Markup: MARKUP = | |
| 236 | struct | |
| 237 | ||
| 30221 | 238 | (** markup elements **) | 
| 239 | ||
| 23658 | 240 | (* basic markup *) | 
| 23623 | 241 | |
| 28017 | 242 | type T = string * Properties.T; | 
| 23637 | 243 | |
| 38474 
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
 wenzelm parents: 
38429diff
changeset | 244 | val empty = ("", []);
 | 
| 23637 | 245 | |
| 38474 
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
 wenzelm parents: 
38429diff
changeset | 246 | fun is_empty ("", _) = true
 | 
| 
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
 wenzelm parents: 
38429diff
changeset | 247 | | is_empty _ = false; | 
| 27883 | 248 | |
| 23794 | 249 | |
| 23671 | 250 | fun properties more_props ((elem, props): T) = | 
| 28017 | 251 | (elem, fold_rev Properties.put more_props props); | 
| 23671 | 252 | |
| 55551 | 253 | fun markup_elem name = (name, (name, []): T); | 
| 254 | fun markup_string name prop = (name, fn s => (name, [(prop, s)]): T); | |
| 63806 | 255 | fun markup_int name prop = (name, fn i => (name, [(prop, Value.print_int i)]): T); | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 256 | |
| 26977 | 257 | |
| 38721 
ca8b14fa0d0d
added some proof state markup, notably number of subgoals (e.g. for indentation);
 wenzelm parents: 
38474diff
changeset | 258 | (* misc properties *) | 
| 26977 | 259 | |
| 23658 | 260 | val nameN = "name"; | 
| 27818 | 261 | fun name a = properties [(nameN, a)]; | 
| 262 | ||
| 68997 | 263 | val xnameN = "xname"; | 
| 264 | fun xname a = properties [(xnameN, a)]; | |
| 265 | ||
| 23658 | 266 | val kindN = "kind"; | 
| 23671 | 267 | |
| 60744 | 268 | val serialN = "serial"; | 
| 63806 | 269 | fun serial_properties i = [(serialN, Value.print_int i)]; | 
| 60744 | 270 | |
| 52854 
92932931bd82
more general Output.result: allow to update arbitrary properties;
 wenzelm parents: 
52800diff
changeset | 271 | val instanceN = "instance"; | 
| 
92932931bd82
more general Output.result: allow to update arbitrary properties;
 wenzelm parents: 
52800diff
changeset | 272 | |
| 23658 | 273 | |
| 55550 | 274 | (* embedded languages *) | 
| 275 | ||
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 276 | val languageN = "language"; | 
| 55615 
bf4bbe72f740
completion of keywords and symbols based on language context;
 wenzelm parents: 
55613diff
changeset | 277 | val symbolsN = "symbols"; | 
| 55666 | 278 | val antiquotesN = "antiquotes"; | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 279 | val delimitedN = "delimited" | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 280 | |
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 281 | fun is_delimited props = | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 282 | Properties.get props delimitedN = SOME "true"; | 
| 55666 | 283 | |
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 284 | fun language {name, symbols, antiquotes, delimited} =
 | 
| 55666 | 285 | (languageN, | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 286 | [(nameN, name), | 
| 63806 | 287 | (symbolsN, Value.print_bool symbols), | 
| 288 | (antiquotesN, Value.print_bool antiquotes), | |
| 289 | (delimitedN, Value.print_bool delimited)]); | |
| 55550 | 290 | |
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 291 | fun language' {name, symbols, antiquotes} delimited =
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 292 |   language {name = name, symbols = symbols, antiquotes = antiquotes, delimited = delimited};
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 293 | |
| 62231 
25f4a9cd8b68
tuned markup, e.g. relevant for Rendering.tooltip;
 wenzelm parents: 
61864diff
changeset | 294 | val language_Isar = language' {name = "Isar", symbols = true, antiquotes = false};
 | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 295 | val language_method = | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 296 |   language {name = "method", symbols = true, antiquotes = false, delimited = false};
 | 
| 56033 | 297 | val language_attribute = | 
| 298 |   language {name = "attribute", symbols = true, antiquotes = false, delimited = false};
 | |
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 299 | val language_sort = language' {name = "sort", symbols = true, antiquotes = false};
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 300 | val language_type = language' {name = "type", symbols = true, antiquotes = false};
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 301 | val language_term = language' {name = "term", symbols = true, antiquotes = false};
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 302 | val language_prop = language' {name = "prop", symbols = true, antiquotes = false};
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 303 | 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: 
56202diff
changeset | 304 | val language_SML = language' {name = "SML", symbols = false, antiquotes = false};
 | 
| 61600 
1ca11ddfcc70
clarified completion of explicit symbols (see also f6bd97a587b7, e0e4ac981cf1);
 wenzelm parents: 
61598diff
changeset | 305 | val language_document = language' {name = "document", symbols = false, antiquotes = true};
 | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 306 | val language_antiquotation = | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 307 |   language {name = "antiquotation", symbols = true, antiquotes = false, delimited = true};
 | 
| 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 308 | val language_text = language' {name = "text", symbols = true, antiquotes = false};
 | 
| 62772 | 309 | val language_verbatim = language' {name = "verbatim_text", symbols = true, antiquotes = false};
 | 
| 67429 | 310 | val language_latex = language' {name = "latex", symbols = false, antiquotes = false};
 | 
| 55828 
42ac3cfb89f6
clarified language markup: added "delimited" property;
 wenzelm parents: 
55763diff
changeset | 311 | 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: 
56033diff
changeset | 312 | val language_path = language {name = "path", symbols = false, antiquotes = false, delimited = true};
 | 
| 62772 | 313 | val language_mixfix = | 
| 314 |   language {name = "mixfix_annotation", symbols = true, antiquotes = false, delimited = true};
 | |
| 55550 | 315 | |
| 316 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 317 | (* formal entities *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 318 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 319 | val (bindingN, binding) = markup_elem "binding"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 320 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 321 | val entityN = "entity"; | 
| 63337 | 322 | fun entity kind name = | 
| 323 | (entityN, | |
| 324 | (if name = "" then [] else [(nameN, name)]) @ (if kind = "" then [] else [(kindN, kind)])); | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 325 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 326 | fun get_entity_kind (name, props) = | 
| 66044 | 327 | if name = entityN then Properties.get props kindN | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 328 | else NONE; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 329 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 330 | val defN = "def"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 331 | val refN = "ref"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 332 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 333 | |
| 55672 
5e25cc741ab9
support for completion within the formal context;
 wenzelm parents: 
55666diff
changeset | 334 | (* completion *) | 
| 
5e25cc741ab9
support for completion within the formal context;
 wenzelm parents: 
55666diff
changeset | 335 | |
| 55694 
a1184dfb8e00
clarified semantic completion: retain kind.full_name as official item name for history;
 wenzelm parents: 
55687diff
changeset | 336 | val (completionN, completion) = markup_elem "completion"; | 
| 55914 
c5b752d549e3
clarified init_assignable: make double-sure that initial values are reset;
 wenzelm parents: 
55837diff
changeset | 337 | val (no_completionN, no_completion) = markup_elem "no_completion"; | 
| 55672 
5e25cc741ab9
support for completion within the formal context;
 wenzelm parents: 
55666diff
changeset | 338 | |
| 
5e25cc741ab9
support for completion within the formal context;
 wenzelm parents: 
55666diff
changeset | 339 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 340 | (* position *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 341 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 342 | val lineN = "line"; | 
| 58978 
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
 wenzelm parents: 
58855diff
changeset | 343 | val end_lineN = "end_line"; | 
| 
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
 wenzelm parents: 
58855diff
changeset | 344 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 345 | val offsetN = "offset"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 346 | val end_offsetN = "end_offset"; | 
| 58978 
e42da880c61e
more position information, e.g. relevant for errors in generated ML source;
 wenzelm parents: 
58855diff
changeset | 347 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 348 | val fileN = "file"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 349 | val idN = "id"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 350 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 351 | val position_properties' = [fileN, idN]; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 352 | 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: 
46894diff
changeset | 353 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 354 | val (positionN, position) = markup_elem "position"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 355 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 356 | |
| 58464 | 357 | (* expression *) | 
| 358 | ||
| 62806 | 359 | val expressionN = "expression"; | 
| 360 | fun expression kind = (expressionN, if kind = "" then [] else [(kindN, kind)]); | |
| 58464 | 361 | |
| 362 | ||
| 58544 
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
 wenzelm parents: 
58464diff
changeset | 363 | (* citation *) | 
| 
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
 wenzelm parents: 
58464diff
changeset | 364 | |
| 58545 
30b75b7958d6
citation tooltip/hyperlink based on open buffers with .bib files;
 wenzelm parents: 
58544diff
changeset | 365 | val (citationN, citation) = markup_string "citation" nameN; | 
| 58544 
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
 wenzelm parents: 
58464diff
changeset | 366 | |
| 
340f130b3d38
bibtex support in ML: document antiquotation @{cite} with markup;
 wenzelm parents: 
58464diff
changeset | 367 | |
| 54702 
3daeba5130f0
added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
 wenzelm parents: 
53378diff
changeset | 368 | (* external resources *) | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 369 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 370 | val (pathN, path) = markup_string "path" nameN; | 
| 54702 
3daeba5130f0
added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
 wenzelm parents: 
53378diff
changeset | 371 | val (urlN, url) = markup_string "url" nameN; | 
| 61660 
78b371644654
added antiquotation @{doc}, e.g. useful for demonstration purposes;
 wenzelm parents: 
61614diff
changeset | 372 | 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: 
46894diff
changeset | 373 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 374 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 375 | (* pretty printing *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 376 | |
| 62783 | 377 | val markupN = "markup"; | 
| 62786 | 378 | val consistentN = "consistent"; | 
| 62789 | 379 | val unbreakableN = "unbreakable"; | 
| 62786 | 380 | val indentN = "indent"; | 
| 381 | ||
| 62789 | 382 | val block_properties = [markupN, consistentN, unbreakableN, indentN]; | 
| 62786 | 383 | |
| 61864 | 384 | val widthN = "width"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 385 | |
| 61864 | 386 | val blockN = "block"; | 
| 387 | fun block c i = | |
| 388 | (blockN, | |
| 63806 | 389 | (if c then [(consistentN, Value.print_bool c)] else []) @ | 
| 390 | (if i <> 0 then [(indentN, Value.print_int i)] else [])); | |
| 61864 | 391 | |
| 61862 
e2a9e46ac0fb
support pretty break indent, like underlying ML systems;
 wenzelm parents: 
61660diff
changeset | 392 | val breakN = "break"; | 
| 61864 | 393 | fun break w i = | 
| 394 | (breakN, | |
| 63806 | 395 | (if w <> 0 then [(widthN, Value.print_int w)] else []) @ | 
| 396 | (if i <> 0 then [(indentN, Value.print_int i)] else [])); | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 397 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 398 | val (fbreakN, fbreak) = markup_elem "fbreak"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 399 | |
| 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: 
51228diff
changeset | 400 | 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: 
51228diff
changeset | 401 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 402 | |
| 56548 | 403 | (* text properties *) | 
| 404 | ||
| 405 | val (wordsN, words) = markup_elem "words"; | |
| 67506 
30233285270a
more markup: disable spell-checker for raw latex;
 wenzelm parents: 
67429diff
changeset | 406 | val (no_wordsN, no_words) = markup_elem "no_words"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 407 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 408 | val (hiddenN, hidden) = markup_elem "hidden"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 409 | |
| 68298 
2c3ce27cf4a8
markup for deleted fragments of token source (NB: quoted tokens transform "\123" implicitly);
 wenzelm parents: 
68101diff
changeset | 410 | val (deleteN, delete) = markup_elem "delete"; | 
| 
2c3ce27cf4a8
markup for deleted fragments of token source (NB: quoted tokens transform "\123" implicitly);
 wenzelm parents: 
68101diff
changeset | 411 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 412 | |
| 58048 
aa6296d09e0e
more explicit Method.modifier with reported position;
 wenzelm parents: 
57975diff
changeset | 413 | (* misc entities *) | 
| 56465 | 414 | |
| 415 | val system_optionN = "system_option"; | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 416 | |
| 67219 | 417 | val sessionN = "session"; | 
| 418 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 419 | val theoryN = "theory"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 420 | val classN = "class"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 421 | val type_nameN = "type_name"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 422 | val constantN = "constant"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 423 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 424 | val (fixedN, fixed) = markup_string "fixed" nameN; | 
| 53378 
07990ba8c0ea
cases: more position information and PIDE markup;
 wenzelm parents: 
53055diff
changeset | 425 | 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: 
46894diff
changeset | 426 | val (dynamic_factN, dynamic_fact) = markup_string "dynamic_fact" nameN; | 
| 63337 | 427 | val (literal_factN, literal_fact) = markup_string "literal_fact" nameN; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 428 | |
| 58048 
aa6296d09e0e
more explicit Method.modifier with reported position;
 wenzelm parents: 
57975diff
changeset | 429 | val method_modifierN = "method_modifier"; | 
| 
aa6296d09e0e
more explicit Method.modifier with reported position;
 wenzelm parents: 
57975diff
changeset | 430 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 431 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 432 | (* inner syntax *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 433 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 434 | val (tfreeN, tfree) = markup_elem "tfree"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 435 | val (tvarN, tvar) = markup_elem "tvar"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 436 | val (freeN, free) = markup_elem "free"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 437 | val (skolemN, skolem) = markup_elem "skolem"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 438 | val (boundN, bound) = markup_elem "bound"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 439 | val (varN, var) = markup_elem "var"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 440 | val (numeralN, numeral) = markup_elem "numeral"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 441 | val (literalN, literal) = markup_elem "literal"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 442 | val (delimiterN, delimiter) = markup_elem "delimiter"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 443 | val (inner_stringN, inner_string) = markup_elem "inner_string"; | 
| 55033 | 444 | 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: 
46894diff
changeset | 445 | 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: 
46894diff
changeset | 446 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 447 | 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: 
46894diff
changeset | 448 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 449 | val (sortingN, sorting) = markup_elem "sorting"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 450 | val (typingN, typing) = markup_elem "typing"; | 
| 63347 | 451 | val (class_parameterN, class_parameter) = markup_elem "class_parameter"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 452 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 453 | |
| 60744 | 454 | (* ML *) | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 455 | |
| 55505 | 456 | val (ML_keyword1N, ML_keyword1) = markup_elem "ML_keyword1"; | 
| 457 | val (ML_keyword2N, ML_keyword2) = markup_elem "ML_keyword2"; | |
| 458 | 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: 
46894diff
changeset | 459 | 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: 
46894diff
changeset | 460 | 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: 
46894diff
changeset | 461 | 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: 
46894diff
changeset | 462 | 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: 
46894diff
changeset | 463 | 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: 
46894diff
changeset | 464 | val (ML_commentN, ML_comment) = markup_elem "ML_comment"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 465 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 466 | val ML_defN = "ML_def"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 467 | val ML_openN = "ML_open"; | 
| 55837 | 468 | val ML_structureN = "ML_structure"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 469 | 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: 
46894diff
changeset | 470 | |
| 60744 | 471 | val (ML_breakpointN, ML_breakpoint) = markup_int "ML_breakpoint" serialN; | 
| 472 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 473 | |
| 55550 | 474 | (* antiquotations *) | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 475 | |
| 55526 | 476 | val (antiquotedN, antiquoted) = markup_elem "antiquoted"; | 
| 477 | val (antiquoteN, antiquote) = markup_elem "antiquote"; | |
| 478 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 479 | val ML_antiquotationN = "ML_antiquotation"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 480 | val document_antiquotationN = "document_antiquotation"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 481 | val document_antiquotation_optionN = "document_antiquotation_option"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 482 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 483 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 484 | (* text structure *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 485 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 486 | val (paragraphN, paragraph) = markup_elem "paragraph"; | 
| 50545 
00bdc48c5f71
explicit text_fold markup, which is used by default in Pretty.chunks/chunks2;
 wenzelm parents: 
50543diff
changeset | 487 | 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: 
46894diff
changeset | 488 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 489 | |
| 61449 | 490 | (* Markdown document structure *) | 
| 491 | ||
| 492 | val (markdown_paragraphN, markdown_paragraph) = markup_elem "markdown_paragraph"; | |
| 67323 
d02208cefbdb
PIDE markup for Markdown items (which may consist of multiple paragraphs or lists);
 wenzelm parents: 
67322diff
changeset | 493 | val (markdown_itemN, markdown_item) = markup_elem "markdown_item"; | 
| 67336 | 494 | val (markdown_bulletN, markdown_bullet) = markup_int "markdown_bullet" "depth"; | 
| 61449 | 495 | val (markdown_listN, markdown_list) = markup_string "markdown_list" kindN; | 
| 67336 | 496 | |
| 497 | val itemizeN = "itemize"; | |
| 498 | val enumerateN = "enumerate"; | |
| 499 | val descriptionN = "description"; | |
| 61449 | 500 | |
| 501 | ||
| 59795 | 502 | (* formal input *) | 
| 503 | ||
| 504 | val inputN = "input"; | |
| 63806 | 505 | fun input delimited props = (inputN, (delimitedN, Value.print_bool delimited) :: props); | 
| 59795 | 506 | |
| 507 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 508 | (* outer syntax *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 509 | |
| 59935 | 510 | val (command_keywordN, command_keyword) = markup_elem "command_keyword"; | 
| 66044 | 511 | |
| 66066 | 512 | val commandN = "command"; val command_properties = properties [(kindN, commandN)]; | 
| 513 | val keywordN = "keyword"; val keyword_properties = properties [(kindN, keywordN)]; | |
| 514 | ||
| 55744 
4a4e5686e091
clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
 wenzelm parents: 
55694diff
changeset | 515 | val (keyword1N, keyword1) = markup_elem "keyword1"; | 
| 
4a4e5686e091
clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
 wenzelm parents: 
55694diff
changeset | 516 | val (keyword2N, keyword2) = markup_elem "keyword2"; | 
| 55763 | 517 | 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: 
55914diff
changeset | 518 | val (quasi_keywordN, quasi_keyword) = markup_elem "quasi_keyword"; | 
| 56202 | 519 | val (improperN, improper) = markup_elem "improper"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 520 | val (operatorN, operator) = markup_elem "operator"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 521 | val (stringN, string) = markup_elem "string"; | 
| 59081 | 522 | 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: 
46894diff
changeset | 523 | val (verbatimN, verbatim) = markup_elem "verbatim"; | 
| 55033 | 524 | val (cartoucheN, cartouche) = markup_elem "cartouche"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 525 | val (commentN, comment) = markup_elem "comment"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 526 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 527 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 528 | (* timing *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 529 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 530 | val elapsedN = "elapsed"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 531 | val cpuN = "cpu"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 532 | val gcN = "gc"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 533 | |
| 50781 | 534 | fun timing_properties {elapsed, cpu, gc} =
 | 
| 67000 
1698e9ccef2d
more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
 wenzelm parents: 
66873diff
changeset | 535 | [(elapsedN, Value.print_time elapsed), | 
| 
1698e9ccef2d
more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
 wenzelm parents: 
66873diff
changeset | 536 | (cpuN, Value.print_time cpu), | 
| 
1698e9ccef2d
more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
 wenzelm parents: 
66873diff
changeset | 537 | (gcN, Value.print_time gc)]; | 
| 50781 | 538 | |
| 51665 | 539 | fun parse_timing_properties props = | 
| 540 |  {elapsed = Properties.seconds props elapsedN,
 | |
| 541 | cpu = Properties.seconds props cpuN, | |
| 542 | gc = Properties.seconds props gcN}; | |
| 51218 
6425a0d3b7ac
support for build passing timings from Scala to ML;
 wenzelm parents: 
51217diff
changeset | 543 | |
| 51665 | 544 | val timingN = "timing"; | 
| 545 | fun timing t = (timingN, timing_properties t); | |
| 51218 
6425a0d3b7ac
support for build passing timings from Scala to ML;
 wenzelm parents: 
51217diff
changeset | 546 | |
| 51228 | 547 | |
| 548 | (* command timing *) | |
| 549 | ||
| 550 | val command_timingN = "command_timing"; | |
| 551 | ||
| 552 | fun command_timing_properties {file, offset, name} elapsed =
 | |
| 63806 | 553 | [(fileN, file), (offsetN, Value.print_int offset), | 
| 67000 
1698e9ccef2d
more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
 wenzelm parents: 
66873diff
changeset | 554 | (nameN, name), (elapsedN, Value.print_time elapsed)]; | 
| 51228 | 555 | |
| 556 | fun parse_command_timing_properties props = | |
| 557 | (case (Properties.get props fileN, Properties.get props offsetN, Properties.get props nameN) of | |
| 558 | (SOME file, SOME offset, SOME name) => | |
| 63806 | 559 |       SOME ({file = file, offset = Value.parse_int offset, name = name},
 | 
| 51665 | 560 | Properties.seconds props elapsedN) | 
| 51228 | 561 | | _ => NONE); | 
| 562 | ||
| 563 | ||
| 63474 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 564 | (* indentation *) | 
| 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 565 | |
| 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 566 | val (command_indentN, command_indent) = markup_int "command_indent" indentN; | 
| 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 567 | |
| 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 568 | |
| 
f66e3c3b0fb1
semantic indentation for unstructured proof scripts;
 wenzelm parents: 
63347diff
changeset | 569 | (* goals *) | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 570 | |
| 50543 | 571 | val (goalN, goal) = markup_elem "goal"; | 
| 50537 
08ce81aeeacc
more subgoal markup information, which is potentially useful to manage proof state output;
 wenzelm parents: 
50503diff
changeset | 572 | val (subgoalN, subgoal) = markup_string "subgoal" nameN; | 
| 50215 | 573 | |
| 50450 
358b6020f8b6
generalized notion of active area, where sendback is just one application;
 wenzelm parents: 
50255diff
changeset | 574 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 575 | (* command status *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 576 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 577 | val taskN = "task"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 578 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 579 | val (acceptedN, accepted) = markup_elem "accepted"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 580 | val (forkedN, forked) = markup_elem "forked"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 581 | val (joinedN, joined) = markup_elem "joined"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 582 | val (runningN, running) = markup_elem "running"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 583 | val (finishedN, finished) = markup_elem "finished"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 584 | val (failedN, failed) = markup_elem "failed"; | 
| 68871 
f5c76072db55
more explicit status for "canceled" command within theory node;
 wenzelm parents: 
68822diff
changeset | 585 | val (canceledN, canceled) = markup_elem "canceled"; | 
| 68323 | 586 | val (initializedN, initialized) = markup_elem "initialized"; | 
| 68884 
9b97d0b20d95
clarified quasi_consolidated state: ensure that exports are present for ok nodes;
 wenzelm parents: 
68871diff
changeset | 587 | val (finalizedN, finalized) = markup_elem "finalized"; | 
| 66379 
6392766f3c25
maintain "consolidated" status of theory nodes, which means all evals are finished (but not necessarily prints nor imports);
 wenzelm parents: 
66066diff
changeset | 588 | val (consolidatedN, consolidated) = markup_elem "consolidated"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 589 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 590 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 591 | (* messages *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 592 | |
| 50914 
fe4714886d92
identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
 wenzelm parents: 
50845diff
changeset | 593 | val exec_idN = "exec_id"; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 594 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 595 | val initN = "init"; | 
| 61209 | 596 | val (statusN, status) = markup_elem "status"; | 
| 597 | val (resultN, result) = markup_elem "result"; | |
| 598 | val (writelnN, writeln) = markup_elem "writeln"; | |
| 599 | val (stateN, state) = markup_elem "state" | |
| 600 | val (informationN, information) = markup_elem "information"; | |
| 601 | val (tracingN, tracing) = markup_elem "tracing"; | |
| 602 | val (warningN, warning) = markup_elem "warning"; | |
| 603 | val (legacyN, legacy) = markup_elem "legacy"; | |
| 604 | val (errorN, error) = markup_elem "error"; | |
| 605 | val (systemN, system) = markup_elem "system"; | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 606 | val protocolN = "protocol"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 607 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 608 | val (reportN, report) = markup_elem "report"; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 609 | 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: 
46894diff
changeset | 610 | |
| 64677 
8dc24130e8fe
more uniform treatment of "bad" like other messages (with serial number);
 wenzelm parents: 
63806diff
changeset | 611 | val badN = "bad"; | 
| 
8dc24130e8fe
more uniform treatment of "bad" like other messages (with serial number);
 wenzelm parents: 
63806diff
changeset | 612 | fun bad () = (badN, serial_properties (serial ())); | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 613 | |
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 614 | val (intensifyN, intensify) = markup_elem "intensify"; | 
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 615 | |
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 616 | |
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 617 | (* active areas *) | 
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 618 | |
| 50715 
8cfd585b9162
prefer old graph browser in Isabelle/jEdit, which still produces better layout;
 wenzelm parents: 
50683diff
changeset | 619 | val browserN = "browser" | 
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 620 | val graphviewN = "graphview"; | 
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 621 | |
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 622 | val sendbackN = "sendback"; | 
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 623 | 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: 
52643diff
changeset | 624 | 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: 
52643diff
changeset | 625 | val padding_command = (paddingN, "command"); | 
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 626 | |
| 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 627 | val dialogN = "dialog"; | 
| 63806 | 628 | fun dialog i result = (dialogN, [(serialN, Value.print_int i), (resultN, result)]); | 
| 50500 
c94bba7906d2
identify dialogs via official serial and maintain as result message;
 wenzelm parents: 
50499diff
changeset | 629 | |
| 63681 | 630 | val jedit_actionN = "jedit_action"; | 
| 631 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 632 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 633 | (* protocol message functions *) | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 634 | |
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 635 | val functionN = "function" | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 636 | |
| 52563 | 637 | val assign_update = [(functionN, "assign_update")]; | 
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 638 | val removed_versions = [(functionN, "removed_versions")]; | 
| 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 639 | |
| 52111 
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
 wenzelm parents: 
51990diff
changeset | 640 | fun protocol_handler name = [(functionN, "protocol_handler"), (nameN, name)]; | 
| 
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
 wenzelm parents: 
51990diff
changeset | 641 | |
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 642 | 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: 
46894diff
changeset | 643 | 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: 
46894diff
changeset | 644 | |
| 50683 | 645 | val ML_statistics = (functionN, "ML_statistics"); | 
| 50255 | 646 | |
| 50975 | 647 | val task_statistics = (functionN, "task_statistics"); | 
| 648 | ||
| 51216 | 649 | val command_timing = (functionN, "command_timing"); | 
| 650 | ||
| 66873 
9953ae603a23
provide theory timing information, similar to command timing but always considered relevant;
 wenzelm parents: 
66379diff
changeset | 651 | val theory_timing = (functionN, "theory_timing"); | 
| 
9953ae603a23
provide theory timing information, similar to command timing but always considered relevant;
 wenzelm parents: 
66379diff
changeset | 652 | |
| 68088 | 653 | val exportN = "export"; | 
| 68101 | 654 | type export_args = | 
| 655 |   {id: string option, serial: serial, theory_name: string, name: string, compress: bool}
 | |
| 656 | fun export ({id, serial, theory_name, name, compress}: export_args) =
 | |
| 657 | [(functionN, exportN), (idN, the_default "" id), (serialN, Value.print_int serial), | |
| 68090 | 658 |     ("theory_name", theory_name), (nameN, name), ("compress", Value.print_bool compress)];
 | 
| 68088 | 659 | |
| 50845 | 660 | fun loading_theory name = [("function", "loading_theory"), ("name", name)];
 | 
| 661 | ||
| 662 | fun dest_loading_theory [("function", "loading_theory"), ("name", name)] = SOME name
 | |
| 663 | | dest_loading_theory _ = NONE; | |
| 664 | ||
| 65313 | 665 | val build_session_finished = [("function", "build_session_finished")];
 | 
| 56616 
abc2da18d08d
added protocol command "use_theories", with core functionality of batch build;
 wenzelm parents: 
56548diff
changeset | 666 | |
| 56864 | 667 | val print_operationsN = "print_operations"; | 
| 668 | val print_operations = [(functionN, print_operationsN)]; | |
| 669 | ||
| 50201 
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
 wenzelm parents: 
46894diff
changeset | 670 | |
| 60830 | 671 | (* debugger *) | 
| 672 | ||
| 60842 | 673 | fun debugger_state name = [(functionN, "debugger_state"), (nameN, name)]; | 
| 60834 | 674 | fun debugger_output name = [(functionN, "debugger_output"), (nameN, name)]; | 
| 60830 | 675 | |
| 676 | ||
| 55553 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 677 | (* simplifier trace *) | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 678 | |
| 57594 
037f3b251df5
regular message to refer to Simplifier Trace panel (unused);
 wenzelm parents: 
56864diff
changeset | 679 | val simp_trace_panelN = "simp_trace_panel"; | 
| 
037f3b251df5
regular message to refer to Simplifier Trace panel (unused);
 wenzelm parents: 
56864diff
changeset | 680 | |
| 55553 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 681 | val simp_trace_logN = "simp_trace_log"; | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 682 | val simp_trace_stepN = "simp_trace_step"; | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 683 | val simp_trace_recurseN = "simp_trace_recurse"; | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 684 | val simp_trace_hintN = "simp_trace_hint"; | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 685 | val simp_trace_ignoreN = "simp_trace_ignore"; | 
| 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 686 | |
| 63806 | 687 | fun simp_trace_cancel i = [(functionN, "simp_trace_cancel"), (serialN, Value.print_int i)]; | 
| 55553 
99409ccbe04a
more standard names for protocol and markup elements;
 wenzelm parents: 
55551diff
changeset | 688 | |
| 27969 | 689 | |
| 55672 
5e25cc741ab9
support for completion within the formal context;
 wenzelm parents: 
55666diff
changeset | 690 | |
| 30221 | 691 | (** print mode operations **) | 
| 23704 | 692 | |
| 29325 | 693 | val no_output = ("", "");
 | 
| 23704 | 694 | |
| 695 | local | |
| 62933 
f14569a9ab93
proper output of markup, e.g. relevant for nested ML as used in Pure/System/bash.ML;
 wenzelm parents: 
62806diff
changeset | 696 |   val default = {output = Output_Primitives.markup_fn};
 | 
| 43684 | 697 |   val modes = Synchronized.var "Markup.modes" (Symtab.make [("", default)]);
 | 
| 23704 | 698 | in | 
| 43684 | 699 | 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: 
45674diff
changeset | 700 | 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: 
45674diff
changeset | 701 | (if not (Symtab.defined tab name) then () | 
| 61209 | 702 |        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: 
45674diff
changeset | 703 |        Symtab.update (name, {output = output}) tab));
 | 
| 23704 | 704 | fun get_mode () = | 
| 43684 | 705 | the_default default | 
| 706 | (Library.get_first (Symtab.lookup (Synchronized.value modes)) (print_mode_value ())); | |
| 23623 | 707 | end; | 
| 23704 | 708 | |
| 38474 
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
 wenzelm parents: 
38429diff
changeset | 709 | fun output m = if is_empty m then no_output else #output (get_mode ()) m; | 
| 23704 | 710 | |
| 23719 | 711 | val enclose = output #-> Library.enclose; | 
| 712 | ||
| 25552 | 713 | fun markup m = | 
| 714 | let val (bg, en) = output m | |
| 715 | in Library.enclose (Output.escape bg) (Output.escape en) end; | |
| 716 | ||
| 59125 | 717 | val markups = fold_rev markup; | 
| 718 | ||
| 43665 | 719 | fun markup_only m = markup m ""; | 
| 720 | ||
| 55956 
94d384d621b0
reject internal term names outright, and complete consts instead;
 wenzelm parents: 
55919diff
changeset | 721 | fun markup_report "" = "" | 
| 
94d384d621b0
reject internal term names outright, and complete consts instead;
 wenzelm parents: 
55919diff
changeset | 722 | | markup_report txt = markup report txt; | 
| 
94d384d621b0
reject internal term names outright, and complete consts instead;
 wenzelm parents: 
55919diff
changeset | 723 | |
| 23704 | 724 | end; |