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