src/Pure/PIDE/markup.ML
author wenzelm
Tue, 03 Aug 2021 13:08:23 +0200
changeset 74112 d0527bb2e590
parent 73835 5dae03d50db1
child 74182 72bb7e9143f7
permissions -rw-r--r--
more uniform signatures in ML and Scala;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45670
b84170538043 rearranged files;
wenzelm
parents: 45666
diff changeset
     1
(*  Title:      Pure/PIDE/markup.ML
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
     3
56743
81370dfadb1d tuned signature;
wenzelm
parents: 56733
diff changeset
     4
Quasi-abstract markup elements.
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
     5
*)
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
     6
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
     7
signature MARKUP =
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
     8
sig
28017
4919bd124a58 type Properties.T;
wenzelm
parents: 27969
diff changeset
     9
  type T = string * Properties.T
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
    10
  val empty: T
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
    11
  val is_empty: T -> bool
38229
61d0fe8b96ac more robust treatment of Markup.token;
wenzelm
parents: 37195
diff changeset
    12
  val properties: Properties.T -> T -> T
68997
4278947ba336 more exports;
wenzelm
parents: 68884
diff changeset
    13
  val nameN: string val name: string -> T -> T
4278947ba336 more exports;
wenzelm
parents: 68884
diff changeset
    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: 38871
diff changeset
    15
  val kindN: string
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
    16
  val serialN: string
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
    17
  val serial_properties: int -> Properties.T
52854
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
    18
  val instanceN: string
69889
be04e9a053a7 markup and document markers for some meta data from "Dublin Core Metadata Element Set";
wenzelm
parents: 69887
diff 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: 69887
diff 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: 69887
diff 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: 69887
diff changeset
    22
  val meta_dateN: string val meta_date: T
69962
82e945d472d5 documentation of document markers and re-interpreted command tags;
wenzelm
parents: 69916
diff 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: 69887
diff changeset
    24
  val meta_descriptionN: string val meta_description: T
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    25
  val languageN: string
55615
bf4bbe72f740 completion of keywords and symbols based on language context;
wenzelm
parents: 55613
diff changeset
    26
  val symbolsN: string
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    27
  val delimitedN: string
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    28
  val is_delimited: Properties.T -> bool
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    29
  val language: {name: string, symbols: bool, antiquotes: bool, delimited: bool} -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    30
  val language': {name: string, symbols: bool, antiquotes: bool} -> bool -> T
62231
25f4a9cd8b68 tuned markup, e.g. relevant for Rendering.tooltip;
wenzelm
parents: 61864
diff changeset
    31
  val language_Isar: bool -> T
55761
213b9811f59f method language markup, e.g. relevant to prevent outer keyword completion;
wenzelm
parents: 55750
diff changeset
    32
  val language_method: T
56033
513c2b0ea565 more markup;
wenzelm
parents: 55956
diff changeset
    33
  val language_attribute: T
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    34
  val language_sort: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    35
  val language_type: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    36
  val language_term: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    37
  val language_prop: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    38
  val language_ML: bool -> T
56278
2576d3a40ed6 separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents: 56202
diff changeset
    39
  val language_SML: bool -> T
61600
1ca11ddfcc70 clarified completion of explicit symbols (see also f6bd97a587b7, e0e4ac981cf1);
wenzelm
parents: 61598
diff changeset
    40
  val language_document: bool -> T
69887
b9985133805d added semantic document markers;
wenzelm
parents: 69788
diff changeset
    41
  val language_document_marker: T
55653
528de9a20054 more markup -- complete symbols within antiquotation, notably with broken arguments;
wenzelm
parents: 55615
diff changeset
    42
  val language_antiquotation: T
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    43
  val language_text: bool -> T
62520
2382876c238b more PIDE markup;
wenzelm
parents: 62231
diff changeset
    44
  val language_verbatim: bool -> T
67429
95877cc6630e allow LaTeX source as formal comment;
wenzelm
parents: 67336
diff changeset
    45
  val language_latex: bool -> T
55613
ad446b45efff more markup;
wenzelm
parents: 55561
diff changeset
    46
  val language_rail: T
72841
fd8d82c4433b more accurate markup (refining 1c59b555ac4a);
wenzelm
parents: 72763
diff changeset
    47
  val language_path: bool -> T
72843
dd56ba1974e6 clarified markup (refining 1c59b555ac4a);
wenzelm
parents: 72841
diff changeset
    48
  val language_url: bool -> T
62772
77bbe5af41c3 more language markup;
wenzelm
parents: 62520
diff changeset
    49
  val language_mixfix: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    50
  val bindingN: string val binding: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    51
  val entityN: string val entity: string -> string -> T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    52
  val defN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    53
  val refN: string
55694
a1184dfb8e00 clarified semantic completion: retain kind.full_name as official item name for history;
wenzelm
parents: 55687
diff changeset
    54
  val completionN: string val completion: T
55914
c5b752d549e3 clarified init_assignable: make double-sure that initial values are reset;
wenzelm
parents: 55837
diff changeset
    55
  val no_completionN: string val no_completion: T
69557
e72360fef69a update theory sources based on PIDE markup;
wenzelm
parents: 69381
diff changeset
    56
  val updateN: string val update: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    57
  val lineN: string
58978
e42da880c61e more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents: 58855
diff changeset
    58
  val end_lineN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    59
  val offsetN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    60
  val end_offsetN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    61
  val fileN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    62
  val idN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    63
  val position_properties: string list
72708
0cc96d337e8f tuned signature;
wenzelm
parents: 72707
diff changeset
    64
  val position_property: Properties.entry -> bool
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    65
  val positionN: string val position: T
62806
de9bf8171626 more markup;
wenzelm
parents: 62789
diff changeset
    66
  val expressionN: string val expression: string -> T
58545
30b75b7958d6 citation tooltip/hyperlink based on open buffers with .bib files;
wenzelm
parents: 58544
diff changeset
    67
  val citationN: string val citation: string -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    68
  val pathN: string val path: string -> T
70016
a8142ac5e4b6 more PIDE markup and hyperlinks;
wenzelm
parents: 69968
diff changeset
    69
  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: 53378
diff changeset
    70
  val urlN: string val url: string -> T
61660
78b371644654 added antiquotation @{doc}, e.g. useful for demonstration purposes;
wenzelm
parents: 61614
diff changeset
    71
  val docN: string val doc: string -> T
72763
3cc73d00553c added document antiquotation @{tool};
wenzelm
parents: 72708
diff changeset
    72
  val toolN: string val tool: string -> T
62788
374820748c70 unused;
wenzelm
parents: 62786
diff changeset
    73
  val markupN: string
374820748c70 unused;
wenzelm
parents: 62786
diff changeset
    74
  val consistentN: string
62789
ce15dd971965 explicit property for unbreakable block;
wenzelm
parents: 62788
diff changeset
    75
  val unbreakableN: string
62786
2461a58b3587 clarified treatment of properties;
wenzelm
parents: 62783
diff changeset
    76
  val block_properties: string list
62788
374820748c70 unused;
wenzelm
parents: 62786
diff changeset
    77
  val indentN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    78
  val widthN: string
61864
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
    79
  val blockN: string val block: bool -> int -> T
61862
e2a9e46ac0fb support pretty break indent, like underlying ML systems;
wenzelm
parents: 61660
diff changeset
    80
  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: 46894
diff changeset
    81
  val fbreakN: string val fbreak: T
51570
3633828d80fc basic support for Pretty.item, which is considered as logical markup and interpreted in Isabelle/Scala, but ignored elsewhere (TTY, latex etc.);
wenzelm
parents: 51228
diff changeset
    82
  val itemN: string val item: T
56548
ae6870efc28d markup for prose words within formal comments;
wenzelm
parents: 56465
diff changeset
    83
  val wordsN: string val words: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    84
  val hiddenN: string val hidden: T
68298
2c3ce27cf4a8 markup for deleted fragments of token source (NB: quoted tokens transform "\123" implicitly);
wenzelm
parents: 68101
diff changeset
    85
  val deleteN: string val delete: T
71912
b9fbc93f3a24 clarified markup;
wenzelm
parents: 71902
diff changeset
    86
  val bash_functionN: string
b9fbc93f3a24 clarified markup;
wenzelm
parents: 71902
diff changeset
    87
  val scala_functionN: string
56465
6ad693903e22 more positions and markup;
wenzelm
parents: 56278
diff changeset
    88
  val system_optionN: string
67219
81e9804b2014 added document antiquotation @{session name};
wenzelm
parents: 67188
diff changeset
    89
  val sessionN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    90
  val theoryN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    91
  val classN: string
74112
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
    92
  val localeN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    93
  val type_nameN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    94
  val constantN: string
74112
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
    95
  val axiomN: string
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
    96
  val factN: string
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
    97
  val oracleN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    98
  val fixedN: string val fixed: string -> T
53378
07990ba8c0ea cases: more position information and PIDE markup;
wenzelm
parents: 53055
diff changeset
    99
  val caseN: string val case_: string -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   100
  val dynamic_factN: string val dynamic_fact: string -> T
63337
ae9330fdbc16 position information for literal facts;
wenzelm
parents: 62933
diff changeset
   101
  val literal_factN: string val literal_fact: string -> T
74112
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   102
  val attributeN: string
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   103
  val methodN: string
58048
aa6296d09e0e more explicit Method.modifier with reported position;
wenzelm
parents: 57975
diff changeset
   104
  val method_modifierN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   105
  val tfreeN: string val tfree: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   106
  val tvarN: string val tvar: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   107
  val freeN: string val free: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   108
  val skolemN: string val skolem: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   109
  val boundN: string val bound: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   110
  val varN: string val var: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   111
  val numeralN: string val numeral: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   112
  val literalN: string val literal: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   113
  val delimiterN: string val delimiter: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   114
  val inner_stringN: string val inner_string: T
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   115
  val inner_cartoucheN: string val inner_cartouche: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   116
  val token_rangeN: string val token_range: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   117
  val sortingN: string val sorting: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   118
  val typingN: string val typing: T
63347
e344dc82f6c2 report class parameters within instantiation;
wenzelm
parents: 63337
diff changeset
   119
  val class_parameterN: string val class_parameter: T
55505
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   120
  val ML_keyword1N: string val ML_keyword1: T
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   121
  val ML_keyword2N: string val ML_keyword2: T
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   122
  val ML_keyword3N: string val ML_keyword3: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   123
  val ML_delimiterN: string val ML_delimiter: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   124
  val ML_tvarN: string val ML_tvar: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   125
  val ML_numeralN: string val ML_numeral: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   126
  val ML_charN: string val ML_char: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   127
  val ML_stringN: string val ML_string: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   128
  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: 46894
diff changeset
   129
  val ML_defN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   130
  val ML_openN: string
55837
154855d9a564 clarified names of antiquotations and markup;
wenzelm
parents: 55828
diff changeset
   131
  val ML_structureN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   132
  val ML_typingN: string val ML_typing: T
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
   133
  val ML_breakpointN: string val ML_breakpoint: int -> T
55526
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   134
  val antiquotedN: string val antiquoted: T
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   135
  val antiquoteN: string val antiquote: T
69381
4c9b4e2c5460 more general command 'generate_file' for registered file types, notably Haskell;
wenzelm
parents: 69345
diff changeset
   136
  val file_typeN: string
4c9b4e2c5460 more general command 'generate_file' for registered file types, notably Haskell;
wenzelm
parents: 69345
diff changeset
   137
  val antiquotationN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   138
  val ML_antiquotationN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   139
  val document_antiquotationN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   140
  val document_antiquotation_optionN: string
69965
da5e7278286b more markup for various text kinds, notably for nested formal comments;
wenzelm
parents: 69962
diff changeset
   141
  val raw_textN: string val raw_text: T
da5e7278286b more markup for various text kinds, notably for nested formal comments;
wenzelm
parents: 69962
diff changeset
   142
  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: 46894
diff changeset
   143
  val paragraphN: string val paragraph: T
50545
00bdc48c5f71 explicit text_fold markup, which is used by default in Pretty.chunks/chunks2;
wenzelm
parents: 50543
diff changeset
   144
  val text_foldN: string val text_fold: T
70229
c03f381fd373 clarified PIDE markup;
wenzelm
parents: 70135
diff changeset
   145
  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: 70016
diff changeset
   146
  val document_tagN: string val document_tag: string -> T
73780
466fae6bf22e compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents: 73419
diff changeset
   147
  val document_latexN: string val document_latex: T
61449
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   148
  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: 67322
diff changeset
   149
  val markdown_itemN: string val markdown_item: T
67336
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   150
  val markdown_bulletN: string val markdown_bullet: int -> T
61449
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   151
  val markdown_listN: string val markdown_list: string -> T
67336
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   152
  val itemizeN: string
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   153
  val enumerateN: string
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   154
  val descriptionN: string
59795
d453c69596cc clarified input source;
wenzelm
parents: 59369
diff changeset
   155
  val inputN: string val input: bool -> Properties.T -> T
59935
343905de27b1 clarified command keyword markup;
wenzelm
parents: 59795
diff changeset
   156
  val command_keywordN: string val command_keyword: T
66066
7ac97dea27d2 tuned signature;
wenzelm
parents: 66044
diff changeset
   157
  val commandN: string val command_properties: T -> T
7ac97dea27d2 tuned signature;
wenzelm
parents: 66044
diff changeset
   158
  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: 46894
diff changeset
   159
  val stringN: string val string: T
59081
2ceb05ee0331 clarified token kind;
wenzelm
parents: 58978
diff changeset
   160
  val alt_stringN: string val alt_string: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   161
  val verbatimN: string val verbatim: T
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   162
  val cartoucheN: string val cartouche: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   163
  val commentN: string val comment: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   164
  val keyword1N: string val keyword1: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   165
  val keyword2N: string val keyword2: T
55763
4b3907cb5654 tuned signature;
wenzelm
parents: 55761
diff changeset
   166
  val keyword3N: string val keyword3: T
55919
2eb8c13339a5 more explicit quasi_keyword markup, for Args.$$$ material, which is somewhere in between of outer and inner syntax;
wenzelm
parents: 55914
diff changeset
   167
  val quasi_keywordN: string val quasi_keyword: T
56202
0a11d17eeeff more markup for improper elements;
wenzelm
parents: 56034
diff changeset
   168
  val improperN: string val improper: T
0a11d17eeeff more markup for improper elements;
wenzelm
parents: 56034
diff changeset
   169
  val operatorN: string val operator: T
69320
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   170
  val comment1N: string val comment1: T
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   171
  val comment2N: string val comment2: T
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   172
  val comment3N: string val comment3: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   173
  val elapsedN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   174
  val cpuN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   175
  val gcN: string
51606
2843cc095a57 additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
wenzelm
parents: 51570
diff changeset
   176
  val timing_properties: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> Properties.T
51228
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   177
  val parse_command_timing_properties:
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   178
    Properties.T -> ({file: string, offset: int, name: string} * Time.time) option
51606
2843cc095a57 additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
wenzelm
parents: 51570
diff changeset
   179
  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: 63347
diff changeset
   180
  val command_indentN: string val command_indent: int -> T
50543
42bbe637be54 fold main goal;
wenzelm
parents: 50537
diff changeset
   181
  val goalN: string val goal: T
50537
08ce81aeeacc more subgoal markup information, which is potentially useful to manage proof state output;
wenzelm
parents: 50503
diff changeset
   182
  val subgoalN: string val subgoal: string -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   183
  val taskN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   184
  val forkedN: string val forked: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   185
  val joinedN: string val joined: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   186
  val runningN: string val running: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   187
  val finishedN: string val finished: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   188
  val failedN: string val failed: T
68871
f5c76072db55 more explicit status for "canceled" command within theory node;
wenzelm
parents: 68822
diff changeset
   189
  val canceledN: string val canceled: T
68323
bf7336731981 more node status information;
wenzelm
parents: 68298
diff changeset
   190
  val initializedN: string val initialized: T
68884
9b97d0b20d95 clarified quasi_consolidated state: ensure that exports are present for ok nodes;
wenzelm
parents: 68871
diff changeset
   191
  val finalizedN: string val finalized: T
70780
034742453594 more robust: avoid update/interrupt of long-running print_consolidation;
wenzelm
parents: 70665
diff changeset
   192
  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: 66066
diff changeset
   193
  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: 50845
diff changeset
   194
  val exec_idN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   195
  val initN: string
61209
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   196
  val statusN: string val status: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   197
  val resultN: string val result: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   198
  val writelnN: string val writeln: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   199
  val stateN: string val state: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   200
  val informationN: string val information: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   201
  val tracingN: string val tracing: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   202
  val warningN: string val warning: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   203
  val legacyN: string val legacy: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   204
  val errorN: string val error: T
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   205
  val systemN: string val system: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   206
  val protocolN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   207
  val reportN: string val report: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   208
  val no_reportN: string val no_report: T
64677
8dc24130e8fe more uniform treatment of "bad" like other messages (with serial number);
wenzelm
parents: 63806
diff changeset
   209
  val badN: string val bad: unit -> T
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   210
  val intensifyN: string val intensify: T
73835
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   211
  val countN: string
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   212
  val ML_profiling_entryN: string
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   213
  val ML_profiling_entry: {name: string, count: int} -> T
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   214
  val ML_profilingN: string
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   215
  val ML_profiling: string -> T
50715
8cfd585b9162 prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents: 50683
diff changeset
   216
  val browserN: string
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   217
  val graphviewN: string
69650
c95edf19133b clarified message;
wenzelm
parents: 69648
diff changeset
   218
  val theory_exportsN: string
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   219
  val sendbackN: string
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   220
  val paddingN: string
50842
777c6026ca93 tuned signature;
wenzelm
parents: 50781
diff changeset
   221
  val padding_line: Properties.entry
52697
6fb98a20c349 explicit padding on command boundary for "auto" generated sendback -- do not replace the corresponding goal command, but append to it;
wenzelm
parents: 52643
diff changeset
   222
  val padding_command: Properties.entry
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   223
  val dialogN: string val dialog: serial -> string -> T
63681
d2448471ffba active jEdit actions;
wenzelm
parents: 63475
diff changeset
   224
  val jedit_actionN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   225
  val functionN: string
72119
d115d50a19c0 provide POLYSTATSDIR to keep $HOME/.polyml clean (requires Poly/ML 52881757b127, otherwise ignored);
wenzelm
parents: 72116
diff changeset
   226
  val ML_statistics: {pid: int, stats_dir: string} -> Properties.T
70665
94442fce40a5 prefer commands_accepted: fewer protocol messages;
wenzelm
parents: 70499
diff changeset
   227
  val commands_accepted: Properties.T
52563
f9a20c2c3b70 tuned protocol terminology;
wenzelm
parents: 52111
diff changeset
   228
  val assign_update: Properties.T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   229
  val removed_versions: Properties.T
73419
22f3f2117ed7 clarified signature: function_thread is determined in Isabelle/Scala, not Isabelle/ML;
wenzelm
parents: 72861
diff changeset
   230
  val invoke_scala: string -> string -> Properties.T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   231
  val cancel_scala: string -> Properties.T
50975
73ec6ad6700e more systematic task statistics;
wenzelm
parents: 50914
diff changeset
   232
  val task_statistics: Properties.entry
51216
e6e7685fc8f8 emit command_timing properties into build log;
wenzelm
parents: 50975
diff changeset
   233
  val command_timing: Properties.entry
66873
9953ae603a23 provide theory timing information, similar to command timing but always considered relevant;
wenzelm
parents: 66379
diff changeset
   234
  val theory_timing: Properties.entry
72002
5c4800f6b25a more robust protocol for "Timing ..." messages, notably for pide_session=true;
wenzelm
parents: 71912
diff changeset
   235
  val session_timing: Properties.entry
50845
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   236
  val loading_theory: string -> Properties.T
65313
347ed6219dab more realistic PIDE build session;
wenzelm
parents: 64677
diff changeset
   237
  val build_session_finished: Properties.T
56864
0446c7ac2e32 support print operations as asynchronous query;
wenzelm
parents: 56743
diff changeset
   238
  val print_operationsN: string
0446c7ac2e32 support print operations as asynchronous query;
wenzelm
parents: 56743
diff changeset
   239
  val print_operations: Properties.T
69788
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   240
  val exportN: string
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   241
  type export_args =
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   242
   {id: string option,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   243
    serial: serial,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   244
    theory_name: string,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   245
    name: string,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   246
    executable: bool,
70499
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   247
    compress: bool,
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   248
    strict: bool}
69788
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   249
  val export: export_args -> Properties.T
60842
5510c8444bc4 protocol support for thread debugger state;
wenzelm
parents: 60834
diff changeset
   250
  val debugger_state: string -> Properties.T
60834
781f1168d31e maintain debugger output messages;
wenzelm
parents: 60830
diff changeset
   251
  val debugger_output: string -> Properties.T
57594
037f3b251df5 regular message to refer to Simplifier Trace panel (unused);
wenzelm
parents: 56864
diff changeset
   252
  val simp_trace_panelN: string
55553
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   253
  val simp_trace_logN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   254
  val simp_trace_stepN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   255
  val simp_trace_recurseN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   256
  val simp_trace_hintN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   257
  val simp_trace_ignoreN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   258
  val simp_trace_cancel: serial -> Properties.T
69345
6bd63c94cf62 tuned signature (see also src/Tools/Haskell/Markup.hs);
wenzelm
parents: 69320
diff changeset
   259
  type output = Output.output * Output.output
6bd63c94cf62 tuned signature (see also src/Tools/Haskell/Markup.hs);
wenzelm
parents: 69320
diff changeset
   260
  val no_output: output
6bd63c94cf62 tuned signature (see also src/Tools/Haskell/Markup.hs);
wenzelm
parents: 69320
diff changeset
   261
  val add_mode: string -> (T -> output) -> unit
6bd63c94cf62 tuned signature (see also src/Tools/Haskell/Markup.hs);
wenzelm
parents: 69320
diff changeset
   262
  val output: T -> output
40131
7cbebd636e79 explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents: 39585
diff changeset
   263
  val enclose: T -> Output.output -> Output.output
25552
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   264
  val markup: T -> string -> string
59125
ee19c92ae8b4 more explicit markup for improper commands;
wenzelm
parents: 59112
diff changeset
   265
  val markups: T list -> string -> string
43665
573d1272f36d tuned signature;
wenzelm
parents: 43593
diff changeset
   266
  val markup_only: T -> string
55956
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   267
  val markup_report: string -> string
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   268
end;
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   269
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   270
structure Markup: MARKUP =
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   271
struct
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   272
30221
14145e81a2fe added markup for binding;
wenzelm
parents: 29522
diff changeset
   273
(** markup elements **)
14145e81a2fe added markup for binding;
wenzelm
parents: 29522
diff changeset
   274
23658
wenzelm
parents: 23644
diff changeset
   275
(* basic markup *)
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   276
28017
4919bd124a58 type Properties.T;
wenzelm
parents: 27969
diff changeset
   277
type T = string * Properties.T;
23637
f3e16ee56f32 added toplevel markup;
wenzelm
parents: 23626
diff changeset
   278
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   279
val empty = ("", []);
23637
f3e16ee56f32 added toplevel markup;
wenzelm
parents: 23626
diff changeset
   280
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   281
fun is_empty ("", _) = true
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   282
  | is_empty _ = false;
27883
e506f0c6d3f0 added is_none;
wenzelm
parents: 27879
diff changeset
   283
23794
ab2edd87b912 added get_string, get_int;
wenzelm
parents: 23786
diff changeset
   284
23671
9e8257472c27 proper position markup;
wenzelm
parents: 23658
diff changeset
   285
fun properties more_props ((elem, props): T) =
28017
4919bd124a58 type Properties.T;
wenzelm
parents: 27969
diff changeset
   286
  (elem, fold_rev Properties.put more_props props);
23671
9e8257472c27 proper position markup;
wenzelm
parents: 23658
diff changeset
   287
55551
4a5f65df29fa tuned signature;
wenzelm
parents: 55550
diff changeset
   288
fun markup_elem name = (name, (name, []): T);
4a5f65df29fa tuned signature;
wenzelm
parents: 55550
diff changeset
   289
fun markup_string name prop = (name, fn s => (name, [(prop, s)]): T);
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   290
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: 46894
diff changeset
   291
26977
e736139b553d added theory_nameN;
wenzelm
parents: 26702
diff changeset
   292
38721
ca8b14fa0d0d added some proof state markup, notably number of subgoals (e.g. for indentation);
wenzelm
parents: 38474
diff changeset
   293
(* misc properties *)
26977
e736139b553d added theory_nameN;
wenzelm
parents: 26702
diff changeset
   294
23658
wenzelm
parents: 23644
diff changeset
   295
val nameN = "name";
27818
74087a19879f added name property operation;
wenzelm
parents: 27804
diff changeset
   296
fun name a = properties [(nameN, a)];
74087a19879f added name property operation;
wenzelm
parents: 27804
diff changeset
   297
68997
4278947ba336 more exports;
wenzelm
parents: 68884
diff changeset
   298
val xnameN = "xname";
4278947ba336 more exports;
wenzelm
parents: 68884
diff changeset
   299
fun xname a = properties [(xnameN, a)];
4278947ba336 more exports;
wenzelm
parents: 68884
diff changeset
   300
23658
wenzelm
parents: 23644
diff changeset
   301
val kindN = "kind";
23671
9e8257472c27 proper position markup;
wenzelm
parents: 23658
diff changeset
   302
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
   303
val serialN = "serial";
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   304
fun serial_properties i = [(serialN, Value.print_int i)];
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
   305
52854
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   306
val instanceN = "instance";
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   307
23658
wenzelm
parents: 23644
diff changeset
   308
69962
82e945d472d5 documentation of document markers and re-interpreted command tags;
wenzelm
parents: 69916
diff changeset
   309
(* 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: 69887
diff changeset
   310
be04e9a053a7 markup and document markers for some meta data from "Dublin Core Metadata Element Set";
wenzelm
parents: 69887
diff changeset
   311
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: 69887
diff changeset
   312
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: 69887
diff changeset
   313
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: 69887
diff changeset
   314
val (meta_dateN, meta_date) = markup_elem "meta_date";
69962
82e945d472d5 documentation of document markers and re-interpreted command tags;
wenzelm
parents: 69916
diff changeset
   315
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: 69887
diff changeset
   316
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: 69887
diff changeset
   317
be04e9a053a7 markup and document markers for some meta data from "Dublin Core Metadata Element Set";
wenzelm
parents: 69887
diff changeset
   318
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   319
(* embedded languages *)
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   320
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   321
val languageN = "language";
55615
bf4bbe72f740 completion of keywords and symbols based on language context;
wenzelm
parents: 55613
diff changeset
   322
val symbolsN = "symbols";
55666
cc350eb1087e refined language context: antiquotes;
wenzelm
parents: 55653
diff changeset
   323
val antiquotesN = "antiquotes";
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   324
val delimitedN = "delimited"
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   325
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   326
fun is_delimited props =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   327
  Properties.get props delimitedN = SOME "true";
55666
cc350eb1087e refined language context: antiquotes;
wenzelm
parents: 55653
diff changeset
   328
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   329
fun language {name, symbols, antiquotes, delimited} =
55666
cc350eb1087e refined language context: antiquotes;
wenzelm
parents: 55653
diff changeset
   330
  (languageN,
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   331
   [(nameN, name),
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   332
    (symbolsN, Value.print_bool symbols),
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   333
    (antiquotesN, Value.print_bool antiquotes),
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   334
    (delimitedN, Value.print_bool delimited)]);
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   335
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   336
fun language' {name, symbols, antiquotes} delimited =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   337
  language {name = name, symbols = symbols, antiquotes = antiquotes, delimited = delimited};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   338
62231
25f4a9cd8b68 tuned markup, e.g. relevant for Rendering.tooltip;
wenzelm
parents: 61864
diff changeset
   339
val language_Isar = language' {name = "Isar", symbols = true, antiquotes = false};
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   340
val language_method =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   341
  language {name = "method", symbols = true, antiquotes = false, delimited = false};
56033
513c2b0ea565 more markup;
wenzelm
parents: 55956
diff changeset
   342
val language_attribute =
513c2b0ea565 more markup;
wenzelm
parents: 55956
diff changeset
   343
  language {name = "attribute", symbols = true, antiquotes = false, delimited = false};
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   344
val language_sort = language' {name = "sort", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   345
val language_type = language' {name = "type", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   346
val language_term = language' {name = "term", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   347
val language_prop = language' {name = "prop", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   348
val language_ML = language' {name = "ML", symbols = false, antiquotes = true};
56278
2576d3a40ed6 separate tokenization and language context for SML: no symbols, no antiquotes;
wenzelm
parents: 56202
diff changeset
   349
val language_SML = language' {name = "SML", symbols = false, antiquotes = false};
61600
1ca11ddfcc70 clarified completion of explicit symbols (see also f6bd97a587b7, e0e4ac981cf1);
wenzelm
parents: 61598
diff changeset
   350
val language_document = language' {name = "document", symbols = false, antiquotes = true};
69887
b9985133805d added semantic document markers;
wenzelm
parents: 69788
diff changeset
   351
val language_document_marker =
b9985133805d added semantic document markers;
wenzelm
parents: 69788
diff changeset
   352
  language {name = "document_marker", symbols = true, antiquotes = true, delimited = true};
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   353
val language_antiquotation =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   354
  language {name = "antiquotation", symbols = true, antiquotes = false, delimited = true};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   355
val language_text = language' {name = "text", symbols = true, antiquotes = false};
62772
77bbe5af41c3 more language markup;
wenzelm
parents: 62520
diff changeset
   356
val language_verbatim = language' {name = "verbatim_text", symbols = true, antiquotes = false};
67429
95877cc6630e allow LaTeX source as formal comment;
wenzelm
parents: 67336
diff changeset
   357
val language_latex = language' {name = "latex", symbols = false, antiquotes = false};
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   358
val language_rail = language {name = "rail", symbols = true, antiquotes = true, delimited = true};
72841
fd8d82c4433b more accurate markup (refining 1c59b555ac4a);
wenzelm
parents: 72763
diff changeset
   359
val language_path = language' {name = "path", symbols = false, antiquotes = false};
72843
dd56ba1974e6 clarified markup (refining 1c59b555ac4a);
wenzelm
parents: 72841
diff changeset
   360
val language_url = language' {name = "url", symbols = false, antiquotes = false};
62772
77bbe5af41c3 more language markup;
wenzelm
parents: 62520
diff changeset
   361
val language_mixfix =
77bbe5af41c3 more language markup;
wenzelm
parents: 62520
diff changeset
   362
  language {name = "mixfix_annotation", symbols = true, antiquotes = false, delimited = true};
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   363
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   364
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   365
(* formal entities *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   366
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   367
val (bindingN, binding) = markup_elem "binding";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   368
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   369
val entityN = "entity";
63337
ae9330fdbc16 position information for literal facts;
wenzelm
parents: 62933
diff changeset
   370
fun entity kind name =
ae9330fdbc16 position information for literal facts;
wenzelm
parents: 62933
diff changeset
   371
  (entityN,
ae9330fdbc16 position information for literal facts;
wenzelm
parents: 62933
diff changeset
   372
    (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: 46894
diff changeset
   373
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   374
val defN = "def";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   375
val refN = "ref";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   376
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   377
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   378
(* completion *)
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   379
55694
a1184dfb8e00 clarified semantic completion: retain kind.full_name as official item name for history;
wenzelm
parents: 55687
diff changeset
   380
val (completionN, completion) = markup_elem "completion";
55914
c5b752d549e3 clarified init_assignable: make double-sure that initial values are reset;
wenzelm
parents: 55837
diff changeset
   381
val (no_completionN, no_completion) = markup_elem "no_completion";
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   382
69557
e72360fef69a update theory sources based on PIDE markup;
wenzelm
parents: 69381
diff changeset
   383
val (updateN, update) = markup_elem "update";
e72360fef69a update theory sources based on PIDE markup;
wenzelm
parents: 69381
diff changeset
   384
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   385
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   386
(* position *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   387
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   388
val lineN = "line";
58978
e42da880c61e more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents: 58855
diff changeset
   389
val end_lineN = "end_line";
e42da880c61e more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents: 58855
diff changeset
   390
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   391
val offsetN = "offset";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   392
val end_offsetN = "end_offset";
58978
e42da880c61e more position information, e.g. relevant for errors in generated ML source;
wenzelm
parents: 58855
diff changeset
   393
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   394
val fileN = "file";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   395
val idN = "id";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   396
72707
f1380c9f3806 clarified signature;
wenzelm
parents: 72692
diff changeset
   397
val position_properties = [lineN, offsetN, end_offsetN, fileN, idN];
72708
0cc96d337e8f tuned signature;
wenzelm
parents: 72707
diff changeset
   398
fun position_property (entry: Properties.entry) = member (op =) position_properties (#1 entry);
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   399
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   400
val (positionN, position) = markup_elem "position";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   401
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   402
58464
5e7fc9974aba support for sub-expression markup;
wenzelm
parents: 58048
diff changeset
   403
(* expression *)
5e7fc9974aba support for sub-expression markup;
wenzelm
parents: 58048
diff changeset
   404
62806
de9bf8171626 more markup;
wenzelm
parents: 62789
diff changeset
   405
val expressionN = "expression";
de9bf8171626 more markup;
wenzelm
parents: 62789
diff changeset
   406
fun expression kind = (expressionN, if kind = "" then [] else [(kindN, kind)]);
58464
5e7fc9974aba support for sub-expression markup;
wenzelm
parents: 58048
diff changeset
   407
5e7fc9974aba support for sub-expression markup;
wenzelm
parents: 58048
diff changeset
   408
58544
340f130b3d38 bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents: 58464
diff changeset
   409
(* citation *)
340f130b3d38 bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents: 58464
diff changeset
   410
58545
30b75b7958d6 citation tooltip/hyperlink based on open buffers with .bib files;
wenzelm
parents: 58544
diff changeset
   411
val (citationN, citation) = markup_string "citation" nameN;
58544
340f130b3d38 bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents: 58464
diff changeset
   412
340f130b3d38 bibtex support in ML: document antiquotation @{cite} with markup;
wenzelm
parents: 58464
diff changeset
   413
54702
3daeba5130f0 added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents: 53378
diff changeset
   414
(* external resources *)
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   415
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   416
val (pathN, path) = markup_string "path" nameN;
70016
a8142ac5e4b6 more PIDE markup and hyperlinks;
wenzelm
parents: 69968
diff changeset
   417
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: 53378
diff changeset
   418
val (urlN, url) = markup_string "url" nameN;
61660
78b371644654 added antiquotation @{doc}, e.g. useful for demonstration purposes;
wenzelm
parents: 61614
diff changeset
   419
val (docN, doc) = markup_string "doc" nameN;
72763
3cc73d00553c added document antiquotation @{tool};
wenzelm
parents: 72708
diff changeset
   420
val (toolN, tool) = markup_string "tool" nameN;
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   421
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   422
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   423
(* pretty printing *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   424
62783
75ee05386b90 explicit mixfix block properties;
wenzelm
parents: 62772
diff changeset
   425
val markupN = "markup";
62786
2461a58b3587 clarified treatment of properties;
wenzelm
parents: 62783
diff changeset
   426
val consistentN = "consistent";
62789
ce15dd971965 explicit property for unbreakable block;
wenzelm
parents: 62788
diff changeset
   427
val unbreakableN = "unbreakable";
62786
2461a58b3587 clarified treatment of properties;
wenzelm
parents: 62783
diff changeset
   428
val indentN = "indent";
2461a58b3587 clarified treatment of properties;
wenzelm
parents: 62783
diff changeset
   429
62789
ce15dd971965 explicit property for unbreakable block;
wenzelm
parents: 62788
diff changeset
   430
val block_properties = [markupN, consistentN, unbreakableN, indentN];
62786
2461a58b3587 clarified treatment of properties;
wenzelm
parents: 62783
diff changeset
   431
61864
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   432
val widthN = "width";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   433
61864
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   434
val blockN = "block";
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   435
fun block c i =
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   436
  (blockN,
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   437
    (if c then [(consistentN, Value.print_bool c)] else []) @
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   438
    (if i <> 0 then [(indentN, Value.print_int i)] else []));
61864
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   439
61862
e2a9e46ac0fb support pretty break indent, like underlying ML systems;
wenzelm
parents: 61660
diff changeset
   440
val breakN = "break";
61864
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   441
fun break w i =
3a5992c3410c support for blocks with consistent breaks;
wenzelm
parents: 61862
diff changeset
   442
  (breakN,
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   443
    (if w <> 0 then [(widthN, Value.print_int w)] else []) @
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   444
    (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: 46894
diff changeset
   445
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   446
val (fbreakN, fbreak) = markup_elem "fbreak";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   447
51570
3633828d80fc basic support for Pretty.item, which is considered as logical markup and interpreted in Isabelle/Scala, but ignored elsewhere (TTY, latex etc.);
wenzelm
parents: 51228
diff changeset
   448
val (itemN, item) = markup_elem "item";
3633828d80fc basic support for Pretty.item, which is considered as logical markup and interpreted in Isabelle/Scala, but ignored elsewhere (TTY, latex etc.);
wenzelm
parents: 51228
diff changeset
   449
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   450
56548
ae6870efc28d markup for prose words within formal comments;
wenzelm
parents: 56465
diff changeset
   451
(* text properties *)
ae6870efc28d markup for prose words within formal comments;
wenzelm
parents: 56465
diff changeset
   452
ae6870efc28d markup for prose words within formal comments;
wenzelm
parents: 56465
diff changeset
   453
val (wordsN, words) = markup_elem "words";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   454
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   455
val (hiddenN, hidden) = markup_elem "hidden";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   456
68298
2c3ce27cf4a8 markup for deleted fragments of token source (NB: quoted tokens transform "\123" implicitly);
wenzelm
parents: 68101
diff changeset
   457
val (deleteN, delete) = markup_elem "delete";
2c3ce27cf4a8 markup for deleted fragments of token source (NB: quoted tokens transform "\123" implicitly);
wenzelm
parents: 68101
diff changeset
   458
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   459
58048
aa6296d09e0e more explicit Method.modifier with reported position;
wenzelm
parents: 57975
diff changeset
   460
(* misc entities *)
56465
6ad693903e22 more positions and markup;
wenzelm
parents: 56278
diff changeset
   461
71912
b9fbc93f3a24 clarified markup;
wenzelm
parents: 71902
diff changeset
   462
val bash_functionN = "bash_function";
b9fbc93f3a24 clarified markup;
wenzelm
parents: 71902
diff changeset
   463
val scala_functionN = "scala_function";
56465
6ad693903e22 more positions and markup;
wenzelm
parents: 56278
diff changeset
   464
val system_optionN = "system_option";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   465
67219
81e9804b2014 added document antiquotation @{session name};
wenzelm
parents: 67188
diff changeset
   466
val sessionN = "session";
81e9804b2014 added document antiquotation @{session name};
wenzelm
parents: 67188
diff changeset
   467
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   468
val theoryN = "theory";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   469
val classN = "class";
74112
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   470
val localeN = "locale";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   471
val type_nameN = "type_name";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   472
val constantN = "constant";
74112
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   473
val axiomN = "axiom";
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   474
val factN = "fact";
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   475
val oracleN = "oracle";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   476
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   477
val (fixedN, fixed) = markup_string "fixed" nameN;
53378
07990ba8c0ea cases: more position information and PIDE markup;
wenzelm
parents: 53055
diff changeset
   478
val (caseN, case_) = markup_string "case" nameN;
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   479
val (dynamic_factN, dynamic_fact) = markup_string "dynamic_fact" nameN;
63337
ae9330fdbc16 position information for literal facts;
wenzelm
parents: 62933
diff changeset
   480
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: 46894
diff changeset
   481
74112
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   482
val attributeN = "attribute";
d0527bb2e590 more uniform signatures in ML and Scala;
wenzelm
parents: 73835
diff changeset
   483
val methodN = "method";
58048
aa6296d09e0e more explicit Method.modifier with reported position;
wenzelm
parents: 57975
diff changeset
   484
val method_modifierN = "method_modifier";
aa6296d09e0e more explicit Method.modifier with reported position;
wenzelm
parents: 57975
diff changeset
   485
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   486
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   487
(* inner syntax *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   488
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   489
val (tfreeN, tfree) = markup_elem "tfree";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   490
val (tvarN, tvar) = markup_elem "tvar";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   491
val (freeN, free) = markup_elem "free";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   492
val (skolemN, skolem) = markup_elem "skolem";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   493
val (boundN, bound) = markup_elem "bound";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   494
val (varN, var) = markup_elem "var";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   495
val (numeralN, numeral) = markup_elem "numeral";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   496
val (literalN, literal) = markup_elem "literal";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   497
val (delimiterN, delimiter) = markup_elem "delimiter";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   498
val (inner_stringN, inner_string) = markup_elem "inner_string";
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   499
val (inner_cartoucheN, inner_cartouche) = markup_elem "inner_cartouche";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   500
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   501
val (token_rangeN, token_range) = markup_elem "token_range";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   502
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   503
val (sortingN, sorting) = markup_elem "sorting";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   504
val (typingN, typing) = markup_elem "typing";
63347
e344dc82f6c2 report class parameters within instantiation;
wenzelm
parents: 63337
diff changeset
   505
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: 46894
diff changeset
   506
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   507
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
   508
(* ML *)
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   509
55505
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   510
val (ML_keyword1N, ML_keyword1) = markup_elem "ML_keyword1";
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   511
val (ML_keyword2N, ML_keyword2) = markup_elem "ML_keyword2";
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   512
val (ML_keyword3N, ML_keyword3) = markup_elem "ML_keyword3";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   513
val (ML_delimiterN, ML_delimiter) = markup_elem "ML_delimiter";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   514
val (ML_tvarN, ML_tvar) = markup_elem "ML_tvar";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   515
val (ML_numeralN, ML_numeral) = markup_elem "ML_numeral";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   516
val (ML_charN, ML_char) = markup_elem "ML_char";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   517
val (ML_stringN, ML_string) = markup_elem "ML_string";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   518
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: 46894
diff changeset
   519
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   520
val ML_defN = "ML_def";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   521
val ML_openN = "ML_open";
55837
154855d9a564 clarified names of antiquotations and markup;
wenzelm
parents: 55828
diff changeset
   522
val ML_structureN = "ML_structure";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   523
val (ML_typingN, ML_typing) = markup_elem "ML_typing";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   524
60744
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
   525
val (ML_breakpointN, ML_breakpoint) = markup_int "ML_breakpoint" serialN;
4eba53a0ac3d report possible breakpoint positions;
wenzelm
parents: 59935
diff changeset
   526
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   527
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   528
(* antiquotations *)
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   529
55526
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   530
val (antiquotedN, antiquoted) = markup_elem "antiquoted";
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   531
val (antiquoteN, antiquote) = markup_elem "antiquote";
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   532
69381
4c9b4e2c5460 more general command 'generate_file' for registered file types, notably Haskell;
wenzelm
parents: 69345
diff changeset
   533
val file_typeN = "file_type";
4c9b4e2c5460 more general command 'generate_file' for registered file types, notably Haskell;
wenzelm
parents: 69345
diff changeset
   534
val antiquotationN = "antiquotation";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   535
val ML_antiquotationN = "ML_antiquotation";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   536
val document_antiquotationN = "document_antiquotation";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   537
val document_antiquotation_optionN = "document_antiquotation_option";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   538
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   539
70135
ad6d4a14adb5 report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents: 70016
diff changeset
   540
(* document text *)
69965
da5e7278286b more markup for various text kinds, notably for nested formal comments;
wenzelm
parents: 69962
diff changeset
   541
da5e7278286b more markup for various text kinds, notably for nested formal comments;
wenzelm
parents: 69962
diff changeset
   542
val (raw_textN, raw_text) = markup_elem "raw_text";
da5e7278286b more markup for various text kinds, notably for nested formal comments;
wenzelm
parents: 69962
diff changeset
   543
val (plain_textN, plain_text) = markup_elem "plain_text";
da5e7278286b more markup for various text kinds, notably for nested formal comments;
wenzelm
parents: 69962
diff changeset
   544
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   545
val (paragraphN, paragraph) = markup_elem "paragraph";
50545
00bdc48c5f71 explicit text_fold markup, which is used by default in Pretty.chunks/chunks2;
wenzelm
parents: 50543
diff changeset
   546
val (text_foldN, text_fold) = markup_elem "text_fold";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   547
70229
c03f381fd373 clarified PIDE markup;
wenzelm
parents: 70135
diff changeset
   548
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: 70016
diff changeset
   549
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: 70016
diff changeset
   550
73780
466fae6bf22e compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents: 73419
diff changeset
   551
val (document_latexN, document_latex) = markup_elem "document_latex";
466fae6bf22e compose Latex text as XML, output exported YXML in Isabelle/Scala;
wenzelm
parents: 73419
diff changeset
   552
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   553
61449
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   554
(* Markdown document structure *)
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   555
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   556
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: 67322
diff changeset
   557
val (markdown_itemN, markdown_item) = markup_elem "markdown_item";
67336
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   558
val (markdown_bulletN, markdown_bullet) = markup_int "markdown_bullet" "depth";
61449
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   559
val (markdown_listN, markdown_list) = markup_string "markdown_list" kindN;
67336
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   560
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   561
val itemizeN = "itemize";
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   562
val enumerateN = "enumerate";
3ee6da378183 HTML output for Markdown elements;
wenzelm
parents: 67323
diff changeset
   563
val descriptionN = "description";
61449
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   564
4f31f79cf2d1 report Markdown document structure;
wenzelm
parents: 61209
diff changeset
   565
59795
d453c69596cc clarified input source;
wenzelm
parents: 59369
diff changeset
   566
(* formal input *)
d453c69596cc clarified input source;
wenzelm
parents: 59369
diff changeset
   567
d453c69596cc clarified input source;
wenzelm
parents: 59369
diff changeset
   568
val inputN = "input";
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   569
fun input delimited props = (inputN, (delimitedN, Value.print_bool delimited) :: props);
59795
d453c69596cc clarified input source;
wenzelm
parents: 59369
diff changeset
   570
d453c69596cc clarified input source;
wenzelm
parents: 59369
diff changeset
   571
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   572
(* outer syntax *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   573
59935
343905de27b1 clarified command keyword markup;
wenzelm
parents: 59795
diff changeset
   574
val (command_keywordN, command_keyword) = markup_elem "command_keyword";
66044
bd7516709051 more HTML rendering as in Isabelle/jEdit;
wenzelm
parents: 65313
diff changeset
   575
66066
7ac97dea27d2 tuned signature;
wenzelm
parents: 66044
diff changeset
   576
val commandN = "command"; val command_properties = properties [(kindN, commandN)];
7ac97dea27d2 tuned signature;
wenzelm
parents: 66044
diff changeset
   577
val keywordN = "keyword"; val keyword_properties = properties [(kindN, keywordN)];
7ac97dea27d2 tuned signature;
wenzelm
parents: 66044
diff changeset
   578
55744
4a4e5686e091 clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
wenzelm
parents: 55694
diff changeset
   579
val (keyword1N, keyword1) = markup_elem "keyword1";
4a4e5686e091 clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
wenzelm
parents: 55694
diff changeset
   580
val (keyword2N, keyword2) = markup_elem "keyword2";
55763
4b3907cb5654 tuned signature;
wenzelm
parents: 55761
diff changeset
   581
val (keyword3N, keyword3) = markup_elem "keyword3";
55919
2eb8c13339a5 more explicit quasi_keyword markup, for Args.$$$ material, which is somewhere in between of outer and inner syntax;
wenzelm
parents: 55914
diff changeset
   582
val (quasi_keywordN, quasi_keyword) = markup_elem "quasi_keyword";
56202
0a11d17eeeff more markup for improper elements;
wenzelm
parents: 56034
diff changeset
   583
val (improperN, improper) = markup_elem "improper";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   584
val (operatorN, operator) = markup_elem "operator";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   585
val (stringN, string) = markup_elem "string";
59081
2ceb05ee0331 clarified token kind;
wenzelm
parents: 58978
diff changeset
   586
val (alt_stringN, alt_string) = markup_elem "alt_string";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   587
val (verbatimN, verbatim) = markup_elem "verbatim";
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   588
val (cartoucheN, cartouche) = markup_elem "cartouche";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   589
val (commentN, comment) = markup_elem "comment";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   590
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   591
69320
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   592
(* comments *)
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   593
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   594
val (comment1N, comment1) = markup_elem "comment1";
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   595
val (comment2N, comment2) = markup_elem "comment2";
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   596
val (comment3N, comment3) = markup_elem "comment3";
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   597
fc221fa79741 more comment markup;
wenzelm
parents: 69314
diff changeset
   598
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   599
(* timing *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   600
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   601
val elapsedN = "elapsed";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   602
val cpuN = "cpu";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   603
val gcN = "gc";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   604
50781
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   605
fun timing_properties {elapsed, cpu, gc} =
67000
1698e9ccef2d more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
wenzelm
parents: 66873
diff changeset
   606
 [(elapsedN, Value.print_time elapsed),
1698e9ccef2d more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
wenzelm
parents: 66873
diff changeset
   607
  (cpuN, Value.print_time cpu),
1698e9ccef2d more portable print_time, notably for occasional negative (!) elapsed time of theory_timing;
wenzelm
parents: 66873
diff changeset
   608
  (gcN, Value.print_time gc)];
50781
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   609
51665
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   610
val timingN = "timing";
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   611
fun timing t = (timingN, timing_properties t);
51218
6425a0d3b7ac support for build passing timings from Scala to ML;
wenzelm
parents: 51217
diff changeset
   612
51228
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   613
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   614
(* command timing *)
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   615
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   616
fun parse_command_timing_properties props =
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   617
  (case (Properties.get props fileN, Properties.get props offsetN, Properties.get props nameN) of
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   618
    (SOME file, SOME offset, SOME name) =>
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   619
      SOME ({file = file, offset = Value.parse_int offset, name = name},
51665
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   620
        Properties.seconds props elapsedN)
51228
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   621
  | _ => NONE);
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   622
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   623
63474
f66e3c3b0fb1 semantic indentation for unstructured proof scripts;
wenzelm
parents: 63347
diff changeset
   624
(* indentation *)
f66e3c3b0fb1 semantic indentation for unstructured proof scripts;
wenzelm
parents: 63347
diff changeset
   625
f66e3c3b0fb1 semantic indentation for unstructured proof scripts;
wenzelm
parents: 63347
diff changeset
   626
val (command_indentN, command_indent) = markup_int "command_indent" indentN;
f66e3c3b0fb1 semantic indentation for unstructured proof scripts;
wenzelm
parents: 63347
diff changeset
   627
f66e3c3b0fb1 semantic indentation for unstructured proof scripts;
wenzelm
parents: 63347
diff changeset
   628
f66e3c3b0fb1 semantic indentation for unstructured proof scripts;
wenzelm
parents: 63347
diff changeset
   629
(* goals *)
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   630
50543
42bbe637be54 fold main goal;
wenzelm
parents: 50537
diff changeset
   631
val (goalN, goal) = markup_elem "goal";
50537
08ce81aeeacc more subgoal markup information, which is potentially useful to manage proof state output;
wenzelm
parents: 50503
diff changeset
   632
val (subgoalN, subgoal) = markup_string "subgoal" nameN;
50215
97959912840a more general sendback properties;
wenzelm
parents: 50201
diff changeset
   633
50450
358b6020f8b6 generalized notion of active area, where sendback is just one application;
wenzelm
parents: 50255
diff changeset
   634
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   635
(* command status *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   636
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   637
val taskN = "task";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   638
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   639
val (forkedN, forked) = markup_elem "forked";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   640
val (joinedN, joined) = markup_elem "joined";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   641
val (runningN, running) = markup_elem "running";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   642
val (finishedN, finished) = markup_elem "finished";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   643
val (failedN, failed) = markup_elem "failed";
68871
f5c76072db55 more explicit status for "canceled" command within theory node;
wenzelm
parents: 68822
diff changeset
   644
val (canceledN, canceled) = markup_elem "canceled";
68323
bf7336731981 more node status information;
wenzelm
parents: 68298
diff changeset
   645
val (initializedN, initialized) = markup_elem "initialized";
68884
9b97d0b20d95 clarified quasi_consolidated state: ensure that exports are present for ok nodes;
wenzelm
parents: 68871
diff changeset
   646
val (finalizedN, finalized) = markup_elem "finalized";
70780
034742453594 more robust: avoid update/interrupt of long-running print_consolidation;
wenzelm
parents: 70665
diff changeset
   647
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: 66066
diff changeset
   648
val (consolidatedN, consolidated) = markup_elem "consolidated";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   649
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   650
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   651
(* messages *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   652
50914
fe4714886d92 identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents: 50845
diff changeset
   653
val exec_idN = "exec_id";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   654
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   655
val initN = "init";
61209
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   656
val (statusN, status) = markup_elem "status";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   657
val (resultN, result) = markup_elem "result";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   658
val (writelnN, writeln) = markup_elem "writeln";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   659
val (stateN, state) = markup_elem "state"
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   660
val (informationN, information) = markup_elem "information";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   661
val (tracingN, tracing) = markup_elem "tracing";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   662
val (warningN, warning) = markup_elem "warning";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   663
val (legacyN, legacy) = markup_elem "legacy";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   664
val (errorN, error) = markup_elem "error";
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   665
val (systemN, system) = markup_elem "system";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   666
val protocolN = "protocol";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   667
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   668
val (reportN, report) = markup_elem "report";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   669
val (no_reportN, no_report) = markup_elem "no_report";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   670
64677
8dc24130e8fe more uniform treatment of "bad" like other messages (with serial number);
wenzelm
parents: 63806
diff changeset
   671
val badN = "bad";
8dc24130e8fe more uniform treatment of "bad" like other messages (with serial number);
wenzelm
parents: 63806
diff changeset
   672
fun bad () = (badN, serial_properties (serial ()));
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   673
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   674
val (intensifyN, intensify) = markup_elem "intensify";
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   675
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   676
73835
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   677
(* ML profiling *)
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   678
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   679
val countN = "count";
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   680
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   681
val ML_profiling_entryN = "ML_profiling_entry";
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   682
fun ML_profiling_entry {name, count} =
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   683
  (ML_profiling_entryN, [(nameN, name), (countN, Value.print_int count)]);
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   684
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   685
val (ML_profilingN, ML_profiling) = markup_string "ML_profiling" kindN;
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   686
5dae03d50db1 more formal ML profiling messages;
wenzelm
parents: 73780
diff changeset
   687
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   688
(* active areas *)
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   689
50715
8cfd585b9162 prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents: 50683
diff changeset
   690
val browserN = "browser"
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   691
val graphviewN = "graphview";
69650
c95edf19133b clarified message;
wenzelm
parents: 69648
diff changeset
   692
val theory_exportsN = "theory_exports";
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   693
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   694
val sendbackN = "sendback";
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   695
val paddingN = "padding";
52697
6fb98a20c349 explicit padding on command boundary for "auto" generated sendback -- do not replace the corresponding goal command, but append to it;
wenzelm
parents: 52643
diff changeset
   696
val padding_line = (paddingN, "line");
6fb98a20c349 explicit padding on command boundary for "auto" generated sendback -- do not replace the corresponding goal command, but append to it;
wenzelm
parents: 52643
diff changeset
   697
val padding_command = (paddingN, "command");
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   698
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   699
val dialogN = "dialog";
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   700
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: 50499
diff changeset
   701
63681
d2448471ffba active jEdit actions;
wenzelm
parents: 63475
diff changeset
   702
val jedit_actionN = "jedit_action";
d2448471ffba active jEdit actions;
wenzelm
parents: 63475
diff changeset
   703
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   704
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   705
(* protocol message functions *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   706
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   707
val functionN = "function"
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   708
72119
d115d50a19c0 provide POLYSTATSDIR to keep $HOME/.polyml clean (requires Poly/ML 52881757b127, otherwise ignored);
wenzelm
parents: 72116
diff changeset
   709
fun ML_statistics {pid, stats_dir} =
d115d50a19c0 provide POLYSTATSDIR to keep $HOME/.polyml clean (requires Poly/ML 52881757b127, otherwise ignored);
wenzelm
parents: 72116
diff changeset
   710
  [(functionN, "ML_statistics"), ("pid", Value.print_int pid), ("stats_dir", stats_dir)];
72112
3546dd4ade74 ML statistics via external process: allows monitoring RTS while ML program sleeps;
wenzelm
parents: 72106
diff changeset
   711
70665
94442fce40a5 prefer commands_accepted: fewer protocol messages;
wenzelm
parents: 70499
diff changeset
   712
val commands_accepted = [(functionN, "commands_accepted")];
94442fce40a5 prefer commands_accepted: fewer protocol messages;
wenzelm
parents: 70499
diff changeset
   713
52563
f9a20c2c3b70 tuned protocol terminology;
wenzelm
parents: 52111
diff changeset
   714
val assign_update = [(functionN, "assign_update")];
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   715
val removed_versions = [(functionN, "removed_versions")];
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   716
73419
22f3f2117ed7 clarified signature: function_thread is determined in Isabelle/Scala, not Isabelle/ML;
wenzelm
parents: 72861
diff changeset
   717
fun invoke_scala name id = [(functionN, "invoke_scala"), (nameN, name), (idN, id)];
72332
319dd5c618a5 allow Scala function execution on separate thread: better reactivity, but potential overloading of the JVM;
wenzelm
parents: 72156
diff changeset
   718
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   719
fun cancel_scala id = [(functionN, "cancel_scala"), (idN, id)];
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   720
50975
73ec6ad6700e more systematic task statistics;
wenzelm
parents: 50914
diff changeset
   721
val task_statistics = (functionN, "task_statistics");
73ec6ad6700e more systematic task statistics;
wenzelm
parents: 50914
diff changeset
   722
51216
e6e7685fc8f8 emit command_timing properties into build log;
wenzelm
parents: 50975
diff changeset
   723
val command_timing = (functionN, "command_timing");
e6e7685fc8f8 emit command_timing properties into build log;
wenzelm
parents: 50975
diff changeset
   724
66873
9953ae603a23 provide theory timing information, similar to command timing but always considered relevant;
wenzelm
parents: 66379
diff changeset
   725
val theory_timing = (functionN, "theory_timing");
9953ae603a23 provide theory timing information, similar to command timing but always considered relevant;
wenzelm
parents: 66379
diff changeset
   726
72002
5c4800f6b25a more robust protocol for "Timing ..." messages, notably for pide_session=true;
wenzelm
parents: 71912
diff changeset
   727
val session_timing = (functionN, "session_timing");
5c4800f6b25a more robust protocol for "Timing ..." messages, notably for pide_session=true;
wenzelm
parents: 71912
diff changeset
   728
72692
22aeec526ffd support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents: 72332
diff changeset
   729
fun loading_theory name = [("function", "loading_theory"), (nameN, name)];
50845
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   730
65313
347ed6219dab more realistic PIDE build session;
wenzelm
parents: 64677
diff changeset
   731
val build_session_finished = [("function", "build_session_finished")];
56616
abc2da18d08d added protocol command "use_theories", with core functionality of batch build;
wenzelm
parents: 56548
diff changeset
   732
56864
0446c7ac2e32 support print operations as asynchronous query;
wenzelm
parents: 56743
diff changeset
   733
val print_operationsN = "print_operations";
0446c7ac2e32 support print operations as asynchronous query;
wenzelm
parents: 56743
diff changeset
   734
val print_operations = [(functionN, print_operationsN)];
0446c7ac2e32 support print operations as asynchronous query;
wenzelm
parents: 56743
diff changeset
   735
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   736
69788
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   737
(* export *)
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   738
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   739
val exportN = "export";
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   740
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   741
type export_args =
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   742
 {id: string option,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   743
  serial: serial,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   744
  theory_name: string,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   745
  name: string,
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   746
  executable: bool,
70499
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   747
  compress: bool,
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   748
  strict: bool};
69788
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   749
70499
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   750
fun export ({id, serial, theory_name, name, executable, compress, strict}: export_args) =
69788
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   751
 [(functionN, exportN),
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   752
  (idN, the_default "" id),
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   753
  (serialN, Value.print_int serial),
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   754
  ("theory_name", theory_name),
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   755
  (nameN, name),
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   756
  ("executable", Value.print_bool executable),
70499
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   757
  ("compress", Value.print_bool compress),
f389019024ce allow duplicate exports via strict = false;
wenzelm
parents: 70229
diff changeset
   758
  ("strict", Value.print_bool strict)];
69788
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   759
c175499a7537 added executable flag for exports;
wenzelm
parents: 69650
diff changeset
   760
60830
f56e189350b2 separate channel for debugger output;
wenzelm
parents: 60744
diff changeset
   761
(* debugger *)
f56e189350b2 separate channel for debugger output;
wenzelm
parents: 60744
diff changeset
   762
60842
5510c8444bc4 protocol support for thread debugger state;
wenzelm
parents: 60834
diff changeset
   763
fun debugger_state name = [(functionN, "debugger_state"), (nameN, name)];
60834
781f1168d31e maintain debugger output messages;
wenzelm
parents: 60830
diff changeset
   764
fun debugger_output name = [(functionN, "debugger_output"), (nameN, name)];
60830
f56e189350b2 separate channel for debugger output;
wenzelm
parents: 60744
diff changeset
   765
f56e189350b2 separate channel for debugger output;
wenzelm
parents: 60744
diff changeset
   766
55553
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   767
(* simplifier trace *)
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   768
57594
037f3b251df5 regular message to refer to Simplifier Trace panel (unused);
wenzelm
parents: 56864
diff changeset
   769
val simp_trace_panelN = "simp_trace_panel";
037f3b251df5 regular message to refer to Simplifier Trace panel (unused);
wenzelm
parents: 56864
diff changeset
   770
55553
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   771
val simp_trace_logN = "simp_trace_log";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   772
val simp_trace_stepN = "simp_trace_step";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   773
val simp_trace_recurseN = "simp_trace_recurse";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   774
val simp_trace_hintN = "simp_trace_hint";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   775
val simp_trace_ignoreN = "simp_trace_ignore";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   776
63806
c54a53ef1873 clarified modules;
wenzelm
parents: 63681
diff changeset
   777
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: 55551
diff changeset
   778
27969
46d7057b8614 added messages and process information;
wenzelm
parents: 27894
diff changeset
   779
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   780
30221
14145e81a2fe added markup for binding;
wenzelm
parents: 29522
diff changeset
   781
(** print mode operations **)
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   782
69345
6bd63c94cf62 tuned signature (see also src/Tools/Haskell/Markup.hs);
wenzelm
parents: 69320
diff changeset
   783
type output = Output.output * Output.output;
6bd63c94cf62 tuned signature (see also src/Tools/Haskell/Markup.hs);
wenzelm
parents: 69320
diff changeset
   784
29325
a205acc94356 Markup.no_output;
wenzelm
parents: 29318
diff changeset
   785
val no_output = ("", "");
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   786
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   787
local
62933
f14569a9ab93 proper output of markup, e.g. relevant for nested ML as used in Pure/System/bash.ML;
wenzelm
parents: 62806
diff changeset
   788
  val default = {output = Output_Primitives.markup_fn};
43684
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   789
  val modes = Synchronized.var "Markup.modes" (Symtab.make [("", default)]);
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   790
in
43684
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   791
  fun add_mode name output =
46894
e2ad717ec889 allow redefining pretty/markup modes (not output due to bootstrap issues) -- to support reloading of theory src/HOL/src/Tools/Code_Generator;
wenzelm
parents: 45674
diff changeset
   792
    Synchronized.change modes (fn tab =>
e2ad717ec889 allow redefining pretty/markup modes (not output due to bootstrap issues) -- to support reloading of theory src/HOL/src/Tools/Code_Generator;
wenzelm
parents: 45674
diff changeset
   793
      (if not (Symtab.defined tab name) then ()
61209
7a421e7ef97c tuned signature;
wenzelm
parents: 60842
diff changeset
   794
       else Output.warning ("Redefining markup mode " ^ quote name);
46894
e2ad717ec889 allow redefining pretty/markup modes (not output due to bootstrap issues) -- to support reloading of theory src/HOL/src/Tools/Code_Generator;
wenzelm
parents: 45674
diff changeset
   795
       Symtab.update (name, {output = output}) tab));
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   796
  fun get_mode () =
43684
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   797
    the_default default
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   798
      (Library.get_first (Symtab.lookup (Synchronized.value modes)) (print_mode_value ()));
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   799
end;
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   800
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   801
fun output m = if is_empty m then no_output else #output (get_mode ()) m;
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   802
23719
ccd9cb15c062 more markup for inner and outer syntax;
wenzelm
parents: 23704
diff changeset
   803
val enclose = output #-> Library.enclose;
ccd9cb15c062 more markup for inner and outer syntax;
wenzelm
parents: 23704
diff changeset
   804
25552
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   805
fun markup m =
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   806
  let val (bg, en) = output m
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   807
  in Library.enclose (Output.escape bg) (Output.escape en) end;
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   808
59125
ee19c92ae8b4 more explicit markup for improper commands;
wenzelm
parents: 59112
diff changeset
   809
val markups = fold_rev markup;
ee19c92ae8b4 more explicit markup for improper commands;
wenzelm
parents: 59112
diff changeset
   810
43665
573d1272f36d tuned signature;
wenzelm
parents: 43593
diff changeset
   811
fun markup_only m = markup m "";
573d1272f36d tuned signature;
wenzelm
parents: 43593
diff changeset
   812
55956
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   813
fun markup_report "" = ""
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   814
  | markup_report txt = markup report txt;
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   815
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   816
end;