src/Pure/PIDE/markup.ML
author wenzelm
Thu, 06 Mar 2014 16:12:26 +0100
changeset 55956 94d384d621b0
parent 55919 2eb8c13339a5
child 56033 513c2b0ea565
permissions -rw-r--r--
reject internal term names outright, and complete consts instead; more general Name_Space.check_reports; more compact Markup.markup_report;
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
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
     4
Isabelle-specific implementation of 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
51951
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
     9
  val parse_bool: string -> bool
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
    10
  val print_bool: bool -> string
38414
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
    11
  val parse_int: string -> int
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
    12
  val print_int: int -> string
51988
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
    13
  val parse_real: string -> real
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
    14
  val print_real: real -> string
28017
4919bd124a58 type Properties.T;
wenzelm
parents: 27969
diff changeset
    15
  type T = string * Properties.T
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
    16
  val empty: T
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
    17
  val is_empty: T -> bool
38229
61d0fe8b96ac more robust treatment of Markup.token;
wenzelm
parents: 37195
diff changeset
    18
  val properties: Properties.T -> T -> T
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
    19
  val nameN: string
27818
74087a19879f added name property operation;
wenzelm
parents: 27804
diff changeset
    20
  val name: string -> T -> T
38887
1261481ef5e5 Command.State: add reported positions to markup tree, according main message position or Markup.binding/entity/report occurrences in body;
wenzelm
parents: 38871
diff changeset
    21
  val kindN: string
52854
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
    22
  val instanceN: string
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    23
  val languageN: string
55615
bf4bbe72f740 completion of keywords and symbols based on language context;
wenzelm
parents: 55613
diff changeset
    24
  val symbolsN: string
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    25
  val delimitedN: string
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    26
  val is_delimited: Properties.T -> bool
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    27
  val language: {name: string, symbols: bool, antiquotes: bool, delimited: bool} -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    28
  val language': {name: string, symbols: bool, antiquotes: bool} -> bool -> T
55761
213b9811f59f method language markup, e.g. relevant to prevent outer keyword completion;
wenzelm
parents: 55750
diff changeset
    29
  val language_method: T
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    30
  val language_sort: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    31
  val language_type: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    32
  val language_term: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    33
  val language_prop: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    34
  val language_ML: bool -> T
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    35
  val language_document: bool -> T
55653
528de9a20054 more markup -- complete symbols within antiquotation, notably with broken arguments;
wenzelm
parents: 55615
diff changeset
    36
  val language_antiquotation: T
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
    37
  val language_text: bool -> T
55613
ad446b45efff more markup;
wenzelm
parents: 55561
diff changeset
    38
  val language_rail: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    39
  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
    40
  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
    41
  val get_entity_kind: T -> string option
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    42
  val defN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    43
  val refN: string
55694
a1184dfb8e00 clarified semantic completion: retain kind.full_name as official item name for history;
wenzelm
parents: 55687
diff changeset
    44
  val completionN: string val completion: T
55914
c5b752d549e3 clarified init_assignable: make double-sure that initial values are reset;
wenzelm
parents: 55837
diff changeset
    45
  val no_completionN: string val no_completion: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    46
  val lineN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    47
  val offsetN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    48
  val end_offsetN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    49
  val fileN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    50
  val idN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    51
  val position_properties': string list
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    52
  val position_properties: string list
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    53
  val positionN: string val position: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    54
  val pathN: string val path: string -> T
54702
3daeba5130f0 added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents: 53378
diff changeset
    55
  val urlN: string val url: string -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    56
  val indentN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    57
  val blockN: string val block: int -> T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    58
  val widthN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    59
  val breakN: string val break: int -> T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    60
  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
    61
  val itemN: string val item: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    62
  val hiddenN: string val hidden: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    63
  val theoryN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    64
  val classN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    65
  val type_nameN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    66
  val constantN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    67
  val fixedN: string val fixed: string -> T
53378
07990ba8c0ea cases: more position information and PIDE markup;
wenzelm
parents: 53055
diff changeset
    68
  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
    69
  val dynamic_factN: string val dynamic_fact: string -> T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    70
  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
    71
  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
    72
  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
    73
  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
    74
  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
    75
  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
    76
  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
    77
  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
    78
  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
    79
  val inner_stringN: string val inner_string: T
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
    80
  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
    81
  val inner_commentN: string val inner_comment: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    82
  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
    83
  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
    84
  val typingN: string val typing: T
55505
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
    85
  val ML_keyword1N: string val ML_keyword1: T
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
    86
  val ML_keyword2N: string val ML_keyword2: T
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
    87
  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
    88
  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
    89
  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
    90
  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
    91
  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
    92
  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
    93
  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
    94
  val ML_defN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
    95
  val ML_openN: string
55837
154855d9a564 clarified names of antiquotations and markup;
wenzelm
parents: 55828
diff changeset
    96
  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
    97
  val ML_typingN: string val ML_typing: T
55526
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
    98
  val antiquotedN: string val antiquoted: T
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
    99
  val antiquoteN: string val antiquote: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   100
  val ML_antiquotationN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   101
  val document_antiquotationN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   102
  val document_antiquotation_optionN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   103
  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
   104
  val text_foldN: string val text_fold: T
55750
baa7a1e57f4a back to Markup.command for actual tokens (amending 4a4e5686e091) -- avoid conflict of jEdit token marker with Rendering.text_colors;
wenzelm
parents: 55744
diff changeset
   105
  val commandN: string val command: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   106
  val operatorN: string val operator: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   107
  val stringN: string val string: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   108
  val altstringN: string val altstring: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   109
  val verbatimN: string val verbatim: T
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   110
  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
   111
  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
   112
  val controlN: string val control: T
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   113
  val tokenN: string val token: bool -> Properties.T -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   114
  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
   115
  val keyword2N: string val keyword2: T
55763
4b3907cb5654 tuned signature;
wenzelm
parents: 55761
diff changeset
   116
  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
   117
  val quasi_keywordN: string val quasi_keyword: T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   118
  val elapsedN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   119
  val cpuN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   120
  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
   121
  val timing_properties: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> Properties.T
2843cc095a57 additional timing status for implicitly forked terminal proofs -- proper accounting for interactive Timing dockable etc.;
wenzelm
parents: 51570
diff changeset
   122
  val parse_timing_properties: Properties.T -> {elapsed: Time.time, cpu: Time.time, gc: Time.time}
51228
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   123
  val command_timingN: string
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   124
  val command_timing_properties:
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   125
    {file: string, offset: int, name: string} -> Time.time -> Properties.T
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   126
  val parse_command_timing_properties:
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   127
    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
   128
  val timingN: string val timing: {elapsed: Time.time, cpu: Time.time, gc: Time.time} -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   129
  val subgoalsN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   130
  val proof_stateN: string val proof_state: int -> T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   131
  val stateN: string val state: T
50543
42bbe637be54 fold main goal;
wenzelm
parents: 50537
diff changeset
   132
  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
   133
  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
   134
  val taskN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   135
  val acceptedN: string val accepted: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   136
  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
   137
  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
   138
  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
   139
  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
   140
  val failedN: string val failed: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   141
  val serialN: string
52854
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   142
  val serial_properties: int -> Properties.T
50914
fe4714886d92 identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents: 50845
diff changeset
   143
  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
   144
  val initN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   145
  val statusN: string
50503
50f141b34bb7 enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents: 50500
diff changeset
   146
  val resultN: string
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   147
  val writelnN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   148
  val tracingN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   149
  val warningN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   150
  val errorN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   151
  val protocolN: string
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   152
  val legacyN: string val legacy: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   153
  val promptN: string val prompt: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   154
  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
   155
  val no_reportN: string val no_report: T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   156
  val badN: string val bad: T
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   157
  val intensifyN: string val intensify: T
52643
34c29356930e more explicit Markup.information for messages produced by "auto" tools;
wenzelm
parents: 52563
diff changeset
   158
  val informationN: string val information: T
50715
8cfd585b9162 prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents: 50683
diff changeset
   159
  val browserN: string
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   160
  val graphviewN: string
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   161
  val sendbackN: string
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   162
  val paddingN: string
50842
777c6026ca93 tuned signature;
wenzelm
parents: 50781
diff changeset
   163
  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
   164
  val padding_command: Properties.entry
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   165
  val dialogN: string val dialog: serial -> string -> T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   166
  val functionN: string
52800
1baa5d19ac44 less aggressive flushing: cope with massive amounts of protocol messages, e.g. from threads_trace;
wenzelm
parents: 52697
diff changeset
   167
  val flush: Properties.T
52563
f9a20c2c3b70 tuned protocol terminology;
wenzelm
parents: 52111
diff changeset
   168
  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
   169
  val removed_versions: Properties.T
52111
1fd184eaa310 explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents: 51990
diff changeset
   170
  val protocol_handler: string -> Properties.T
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   171
  val invoke_scala: string -> string -> Properties.T
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   172
  val cancel_scala: string -> Properties.T
53055
0fe8a9972eda some protocol to determine provers according to ML;
wenzelm
parents: 52854
diff changeset
   173
  val sledgehammer_provers: Properties.T
50842
777c6026ca93 tuned signature;
wenzelm
parents: 50781
diff changeset
   174
  val ML_statistics: Properties.entry
50975
73ec6ad6700e more systematic task statistics;
wenzelm
parents: 50914
diff changeset
   175
  val task_statistics: Properties.entry
51216
e6e7685fc8f8 emit command_timing properties into build log;
wenzelm
parents: 50975
diff changeset
   176
  val command_timing: Properties.entry
50845
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   177
  val loading_theory: string -> Properties.T
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   178
  val dest_loading_theory: Properties.T -> string option
55553
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   179
  val simp_trace_logN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   180
  val simp_trace_stepN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   181
  val simp_trace_recurseN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   182
  val simp_trace_hintN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   183
  val simp_trace_ignoreN: string
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   184
  val simp_trace_cancel: serial -> Properties.T
40131
7cbebd636e79 explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents: 39585
diff changeset
   185
  val no_output: Output.output * Output.output
7cbebd636e79 explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents: 39585
diff changeset
   186
  val default_output: T -> Output.output * Output.output
7cbebd636e79 explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents: 39585
diff changeset
   187
  val add_mode: string -> (T -> Output.output * Output.output) -> unit
7cbebd636e79 explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents: 39585
diff changeset
   188
  val output: T -> Output.output * Output.output
7cbebd636e79 explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents: 39585
diff changeset
   189
  val enclose: T -> Output.output -> Output.output
25552
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   190
  val markup: T -> string -> string
43665
573d1272f36d tuned signature;
wenzelm
parents: 43593
diff changeset
   191
  val markup_only: T -> string
55956
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   192
  val markup_report: string -> string
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   193
end;
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   194
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   195
structure Markup: MARKUP =
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   196
struct
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   197
30221
14145e81a2fe added markup for binding;
wenzelm
parents: 29522
diff changeset
   198
(** markup elements **)
14145e81a2fe added markup for binding;
wenzelm
parents: 29522
diff changeset
   199
51988
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   200
(* misc values *)
51951
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   201
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   202
fun parse_bool "true" = true
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   203
  | parse_bool "false" = false
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   204
  | parse_bool s = raise Fail ("Bad boolean: " ^ quote s);
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   205
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   206
val print_bool = Bool.toString;
fab4ab92e812 more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents: 51665
diff changeset
   207
38414
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
   208
fun parse_int s =
43797
fad7758421bf more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents: 43748
diff changeset
   209
  let val i = Int.fromString s in
fad7758421bf more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents: 43748
diff changeset
   210
    if is_none i orelse String.isPrefix "~" s
fad7758421bf more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents: 43748
diff changeset
   211
    then raise Fail ("Bad integer: " ^ quote s)
fad7758421bf more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents: 43748
diff changeset
   212
    else the i
fad7758421bf more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents: 43748
diff changeset
   213
  end;
38414
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
   214
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
   215
val print_int = signed_string_of_int;
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
   216
51988
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   217
fun parse_real s =
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   218
  (case Real.fromString s of
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   219
    SOME x => x
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   220
  | NONE => raise Fail ("Bad real: " ^ quote s));
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   221
51990
cc66addbba6d more uniform Markup.print_real;
wenzelm
parents: 51988
diff changeset
   222
fun print_real x =
cc66addbba6d more uniform Markup.print_real;
wenzelm
parents: 51988
diff changeset
   223
  let val s = signed_string_of_real x in
cc66addbba6d more uniform Markup.print_real;
wenzelm
parents: 51988
diff changeset
   224
    (case space_explode "." s of
cc66addbba6d more uniform Markup.print_real;
wenzelm
parents: 51988
diff changeset
   225
      [a, b] => if forall_string (fn c => c = "0") b then a else s
cc66addbba6d more uniform Markup.print_real;
wenzelm
parents: 51988
diff changeset
   226
    | _ => s)
cc66addbba6d more uniform Markup.print_real;
wenzelm
parents: 51988
diff changeset
   227
  end;
51988
a9725750c53a more uniform Markup.parse_real;
wenzelm
parents: 51951
diff changeset
   228
38414
49f1f657adc2 more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents: 38229
diff changeset
   229
23658
wenzelm
parents: 23644
diff changeset
   230
(* basic markup *)
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   231
28017
4919bd124a58 type Properties.T;
wenzelm
parents: 27969
diff changeset
   232
type T = string * Properties.T;
23637
f3e16ee56f32 added toplevel markup;
wenzelm
parents: 23626
diff changeset
   233
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   234
val empty = ("", []);
23637
f3e16ee56f32 added toplevel markup;
wenzelm
parents: 23626
diff changeset
   235
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   236
fun is_empty ("", _) = true
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   237
  | is_empty _ = false;
27883
e506f0c6d3f0 added is_none;
wenzelm
parents: 27879
diff changeset
   238
23794
ab2edd87b912 added get_string, get_int;
wenzelm
parents: 23786
diff changeset
   239
23671
9e8257472c27 proper position markup;
wenzelm
parents: 23658
diff changeset
   240
fun properties more_props ((elem, props): T) =
28017
4919bd124a58 type Properties.T;
wenzelm
parents: 27969
diff changeset
   241
  (elem, fold_rev Properties.put more_props props);
23671
9e8257472c27 proper position markup;
wenzelm
parents: 23658
diff changeset
   242
55551
4a5f65df29fa tuned signature;
wenzelm
parents: 55550
diff changeset
   243
fun markup_elem name = (name, (name, []): T);
4a5f65df29fa tuned signature;
wenzelm
parents: 55550
diff changeset
   244
fun markup_string name prop = (name, fn s => (name, [(prop, s)]): T);
4a5f65df29fa tuned signature;
wenzelm
parents: 55550
diff changeset
   245
fun markup_int name prop = (name, fn i => (name, [(prop, print_int i)]): T);
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   246
26977
e736139b553d added theory_nameN;
wenzelm
parents: 26702
diff changeset
   247
38721
ca8b14fa0d0d added some proof state markup, notably number of subgoals (e.g. for indentation);
wenzelm
parents: 38474
diff changeset
   248
(* misc properties *)
26977
e736139b553d added theory_nameN;
wenzelm
parents: 26702
diff changeset
   249
23658
wenzelm
parents: 23644
diff changeset
   250
val nameN = "name";
27818
74087a19879f added name property operation;
wenzelm
parents: 27804
diff changeset
   251
fun name a = properties [(nameN, a)];
74087a19879f added name property operation;
wenzelm
parents: 27804
diff changeset
   252
23658
wenzelm
parents: 23644
diff changeset
   253
val kindN = "kind";
23671
9e8257472c27 proper position markup;
wenzelm
parents: 23658
diff changeset
   254
52854
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   255
val instanceN = "instance";
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   256
23658
wenzelm
parents: 23644
diff changeset
   257
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   258
(* embedded languages *)
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   259
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   260
val languageN = "language";
55615
bf4bbe72f740 completion of keywords and symbols based on language context;
wenzelm
parents: 55613
diff changeset
   261
val symbolsN = "symbols";
55666
cc350eb1087e refined language context: antiquotes;
wenzelm
parents: 55653
diff changeset
   262
val antiquotesN = "antiquotes";
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   263
val delimitedN = "delimited"
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   264
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   265
fun is_delimited props =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   266
  Properties.get props delimitedN = SOME "true";
55666
cc350eb1087e refined language context: antiquotes;
wenzelm
parents: 55653
diff changeset
   267
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   268
fun language {name, symbols, antiquotes, delimited} =
55666
cc350eb1087e refined language context: antiquotes;
wenzelm
parents: 55653
diff changeset
   269
  (languageN,
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   270
   [(nameN, name),
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   271
    (symbolsN, print_bool symbols),
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   272
    (antiquotesN, print_bool antiquotes),
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   273
    (delimitedN, print_bool delimited)]);
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   274
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   275
fun language' {name, symbols, antiquotes} delimited =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   276
  language {name = name, symbols = symbols, antiquotes = antiquotes, delimited = delimited};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   277
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   278
val language_method =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   279
  language {name = "method", symbols = true, antiquotes = false, delimited = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   280
val language_sort = language' {name = "sort", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   281
val language_type = language' {name = "type", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   282
val language_term = language' {name = "term", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   283
val language_prop = language' {name = "prop", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   284
val language_ML = language' {name = "ML", symbols = false, antiquotes = true};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   285
val language_document = language' {name = "document", symbols = false, antiquotes = true};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   286
val language_antiquotation =
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   287
  language {name = "antiquotation", symbols = true, antiquotes = false, delimited = true};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   288
val language_text = language' {name = "text", symbols = true, antiquotes = false};
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   289
val language_rail = language {name = "rail", symbols = true, antiquotes = true, delimited = true};
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   290
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   291
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   292
(* formal entities *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   293
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   294
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
   295
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   296
val entityN = "entity";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   297
fun entity kind name = (entityN, [(nameN, name), (kindN, kind)]);
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   298
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   299
fun get_entity_kind (name, props) =
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   300
  if name = entityN then AList.lookup (op =) props kindN
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   301
  else NONE;
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   302
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   303
val defN = "def";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   304
val refN = "ref";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   305
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   306
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   307
(* completion *)
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   308
55694
a1184dfb8e00 clarified semantic completion: retain kind.full_name as official item name for history;
wenzelm
parents: 55687
diff changeset
   309
val (completionN, completion) = markup_elem "completion";
55914
c5b752d549e3 clarified init_assignable: make double-sure that initial values are reset;
wenzelm
parents: 55837
diff changeset
   310
val (no_completionN, no_completion) = markup_elem "no_completion";
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   311
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   312
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   313
(* position *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   314
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   315
val lineN = "line";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   316
val offsetN = "offset";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   317
val end_offsetN = "end_offset";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   318
val fileN = "file";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   319
val idN = "id";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   320
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   321
val position_properties' = [fileN, idN];
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   322
val position_properties = [lineN, offsetN, end_offsetN] @ position_properties';
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   323
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   324
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
   325
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   326
54702
3daeba5130f0 added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents: 53378
diff changeset
   327
(* external resources *)
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   328
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   329
val (pathN, path) = markup_string "path" nameN;
54702
3daeba5130f0 added document antiquotation @{url}, which produces formal markup for LaTeX and PIDE;
wenzelm
parents: 53378
diff changeset
   330
val (urlN, url) = markup_string "url" nameN;
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   331
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   332
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   333
(* pretty printing *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   334
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   335
val indentN = "indent";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   336
val (blockN, block) = markup_int "block" indentN;
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   337
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   338
val widthN = "width";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   339
val (breakN, break) = markup_int "break" widthN;
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   340
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   341
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
   342
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
   343
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
   344
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   345
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   346
(* hidden text *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   347
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   348
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
   349
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   350
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   351
(* logical entities *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   352
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   353
val theoryN = "theory";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   354
val classN = "class";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   355
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
   356
val constantN = "constant";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   357
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   358
val (fixedN, fixed) = markup_string "fixed" nameN;
53378
07990ba8c0ea cases: more position information and PIDE markup;
wenzelm
parents: 53055
diff changeset
   359
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
   360
val (dynamic_factN, dynamic_fact) = markup_string "dynamic_fact" nameN;
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   361
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   362
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   363
(* inner syntax *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   364
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   365
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
   366
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
   367
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
   368
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
   369
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
   370
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
   371
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
   372
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
   373
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
   374
val (inner_stringN, inner_string) = markup_elem "inner_string";
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   375
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
   376
val (inner_commentN, inner_comment) = markup_elem "inner_comment";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   377
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   378
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
   379
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   380
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
   381
val (typingN, typing) = markup_elem "typing";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   382
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   383
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   384
(* ML syntax *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   385
55505
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   386
val (ML_keyword1N, ML_keyword1) = markup_elem "ML_keyword1";
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   387
val (ML_keyword2N, ML_keyword2) = markup_elem "ML_keyword2";
2a1ca7f6607b more uniform ML keyword markup;
wenzelm
parents: 55033
diff changeset
   388
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
   389
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
   390
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
   391
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
   392
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
   393
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
   394
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
   395
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   396
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
   397
val ML_openN = "ML_open";
55837
154855d9a564 clarified names of antiquotations and markup;
wenzelm
parents: 55828
diff changeset
   398
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
   399
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
   400
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   401
55550
bcc643ac071a generic markup for embedded languages;
wenzelm
parents: 55526
diff changeset
   402
(* antiquotations *)
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   403
55526
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   404
val (antiquotedN, antiquoted) = markup_elem "antiquoted";
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   405
val (antiquoteN, antiquote) = markup_elem "antiquote";
39708e59f4b0 more markup;
wenzelm
parents: 55505
diff changeset
   406
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   407
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
   408
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
   409
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
   410
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   411
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   412
(* text structure *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   413
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   414
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
   415
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
   416
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   417
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   418
(* outer syntax *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   419
55750
baa7a1e57f4a back to Markup.command for actual tokens (amending 4a4e5686e091) -- avoid conflict of jEdit token marker with Rendering.text_colors;
wenzelm
parents: 55744
diff changeset
   420
val (commandN, command) = markup_elem "command";
55744
4a4e5686e091 clarified token markup: keyword1/keyword2 is for syntax, and "command" the entity kind;
wenzelm
parents: 55694
diff changeset
   421
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
   422
val (keyword2N, keyword2) = markup_elem "keyword2";
55763
4b3907cb5654 tuned signature;
wenzelm
parents: 55761
diff changeset
   423
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
   424
val (quasi_keywordN, quasi_keyword) = markup_elem "quasi_keyword";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   425
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
   426
val (stringN, string) = markup_elem "string";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   427
val (altstringN, altstring) = markup_elem "altstring";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   428
val (verbatimN, verbatim) = markup_elem "verbatim";
55033
8e8243975860 support for nested text cartouches;
wenzelm
parents: 54702
diff changeset
   429
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
   430
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
   431
val (controlN, control) = markup_elem "control";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   432
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   433
val tokenN = "token";
55828
42ac3cfb89f6 clarified language markup: added "delimited" property;
wenzelm
parents: 55763
diff changeset
   434
fun token delimited props = (tokenN, (delimitedN, print_bool delimited) :: props);
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   435
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   436
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   437
(* timing *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   438
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   439
val elapsedN = "elapsed";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   440
val cpuN = "cpu";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   441
val gcN = "gc";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   442
50781
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   443
fun timing_properties {elapsed, cpu, gc} =
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   444
 [(elapsedN, Time.toString elapsed),
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   445
  (cpuN, Time.toString cpu),
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   446
  (gcN, Time.toString gc)];
a0f22c2d60cc standardized treatment of timing properties;
wenzelm
parents: 50715
diff changeset
   447
51665
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   448
fun parse_timing_properties props =
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   449
 {elapsed = Properties.seconds props elapsedN,
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   450
  cpu = Properties.seconds props cpuN,
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   451
  gc = Properties.seconds props gcN};
51218
6425a0d3b7ac support for build passing timings from Scala to ML;
wenzelm
parents: 51217
diff changeset
   452
51665
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   453
val timingN = "timing";
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   454
fun timing t = (timingN, timing_properties t);
51218
6425a0d3b7ac support for build passing timings from Scala to ML;
wenzelm
parents: 51217
diff changeset
   455
51228
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   456
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   457
(* command timing *)
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   458
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   459
val command_timingN = "command_timing";
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   460
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   461
fun command_timing_properties {file, offset, name} elapsed =
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   462
 [(fileN, file), (offsetN, print_int offset),
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   463
  (nameN, name), (elapsedN, Time.toString elapsed)];
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   464
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   465
fun parse_command_timing_properties props =
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   466
  (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
   467
    (SOME file, SOME offset, SOME name) =>
51665
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   468
      SOME ({file = file, offset = parse_int offset, name = name},
cba83c9f72b9 tuned signature;
wenzelm
parents: 51626
diff changeset
   469
        Properties.seconds props elapsedN)
51228
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   470
  | _ => NONE);
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   471
dff3471dd8bc more tight representation of command timing;
wenzelm
parents: 51218
diff changeset
   472
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   473
(* toplevel *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   474
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   475
val subgoalsN = "subgoals";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   476
val (proof_stateN, proof_state) = markup_int "proof_state" subgoalsN;
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   477
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   478
val (stateN, state) = markup_elem "state";
50543
42bbe637be54 fold main goal;
wenzelm
parents: 50537
diff changeset
   479
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
   480
val (subgoalN, subgoal) = markup_string "subgoal" nameN;
50215
97959912840a more general sendback properties;
wenzelm
parents: 50201
diff changeset
   481
50450
358b6020f8b6 generalized notion of active area, where sendback is just one application;
wenzelm
parents: 50255
diff changeset
   482
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   483
(* command status *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   484
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   485
val taskN = "task";
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
val (acceptedN, accepted) = markup_elem "accepted";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   488
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
   489
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
   490
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
   491
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
   492
val (failedN, failed) = markup_elem "failed";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   493
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   494
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   495
(* messages *)
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   496
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   497
val serialN = "serial";
52854
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   498
fun serial_properties i = [(serialN, print_int i)];
92932931bd82 more general Output.result: allow to update arbitrary properties;
wenzelm
parents: 52800
diff changeset
   499
50914
fe4714886d92 identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents: 50845
diff changeset
   500
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
   501
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   502
val initN = "init";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   503
val statusN = "status";
50503
50f141b34bb7 enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents: 50500
diff changeset
   504
val resultN = "result";
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   505
val writelnN = "writeln";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   506
val tracingN = "tracing";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   507
val warningN = "warning";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   508
val errorN = "error";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   509
val protocolN = "protocol";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   510
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   511
val (legacyN, legacy) = markup_elem "legacy";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   512
val (promptN, prompt) = markup_elem "prompt";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   513
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   514
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
   515
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
   516
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   517
val (badN, bad) = markup_elem "bad";
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   518
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   519
val (intensifyN, intensify) = markup_elem "intensify";
52643
34c29356930e more explicit Markup.information for messages produced by "auto" tools;
wenzelm
parents: 52563
diff changeset
   520
val (informationN, information) = markup_elem "information";
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   521
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   522
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   523
(* active areas *)
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   524
50715
8cfd585b9162 prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents: 50683
diff changeset
   525
val browserN = "browser"
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   526
val graphviewN = "graphview";
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   527
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   528
val sendbackN = "sendback";
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   529
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
   530
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
   531
val padding_command = (paddingN, "command");
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   532
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   533
val dialogN = "dialog";
50503
50f141b34bb7 enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents: 50500
diff changeset
   534
fun dialog i result = (dialogN, [(serialN, print_int i), (resultN, result)]);
50500
c94bba7906d2 identify dialogs via official serial and maintain as result message;
wenzelm
parents: 50499
diff changeset
   535
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   536
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   537
(* protocol message functions *)
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
val functionN = "function"
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   540
52800
1baa5d19ac44 less aggressive flushing: cope with massive amounts of protocol messages, e.g. from threads_trace;
wenzelm
parents: 52697
diff changeset
   541
val flush = [(functionN, "flush")];
1baa5d19ac44 less aggressive flushing: cope with massive amounts of protocol messages, e.g. from threads_trace;
wenzelm
parents: 52697
diff changeset
   542
52563
f9a20c2c3b70 tuned protocol terminology;
wenzelm
parents: 52111
diff changeset
   543
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
   544
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
   545
52111
1fd184eaa310 explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents: 51990
diff changeset
   546
fun protocol_handler name = [(functionN, "protocol_handler"), (nameN, name)];
1fd184eaa310 explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents: 51990
diff changeset
   547
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   548
fun invoke_scala name id = [(functionN, "invoke_scala"), (nameN, name), (idN, id)];
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   549
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
   550
53055
0fe8a9972eda some protocol to determine provers according to ML;
wenzelm
parents: 52854
diff changeset
   551
val sledgehammer_provers = [(functionN, "sledgehammer_provers")];
0fe8a9972eda some protocol to determine provers according to ML;
wenzelm
parents: 52854
diff changeset
   552
50683
34b109c5324c inline ML statistics into build log;
wenzelm
parents: 50545
diff changeset
   553
val ML_statistics = (functionN, "ML_statistics");
50255
d0ec1f0d1d7d some support for ML runtime statistics;
wenzelm
parents: 50215
diff changeset
   554
50975
73ec6ad6700e more systematic task statistics;
wenzelm
parents: 50914
diff changeset
   555
val task_statistics = (functionN, "task_statistics");
73ec6ad6700e more systematic task statistics;
wenzelm
parents: 50914
diff changeset
   556
51216
e6e7685fc8f8 emit command_timing properties into build log;
wenzelm
parents: 50975
diff changeset
   557
val command_timing = (functionN, "command_timing");
e6e7685fc8f8 emit command_timing properties into build log;
wenzelm
parents: 50975
diff changeset
   558
50845
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   559
fun loading_theory name = [("function", "loading_theory"), ("name", name)];
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   560
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   561
fun dest_loading_theory [("function", "loading_theory"), ("name", name)] = SOME name
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   562
  | dest_loading_theory _ = NONE;
477ca927676f immediate theory progress for build_dialog;
wenzelm
parents: 50842
diff changeset
   563
50201
c26369c9eda6 Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents: 46894
diff changeset
   564
55553
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   565
(* simplifier trace *)
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   566
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   567
val simp_trace_logN = "simp_trace_log";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   568
val simp_trace_stepN = "simp_trace_step";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   569
val simp_trace_recurseN = "simp_trace_recurse";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   570
val simp_trace_hintN = "simp_trace_hint";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   571
val simp_trace_ignoreN = "simp_trace_ignore";
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   572
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   573
fun simp_trace_cancel i = [(functionN, "simp_trace_cancel"), (serialN, print_int i)];
99409ccbe04a more standard names for protocol and markup elements;
wenzelm
parents: 55551
diff changeset
   574
27969
46d7057b8614 added messages and process information;
wenzelm
parents: 27894
diff changeset
   575
55672
5e25cc741ab9 support for completion within the formal context;
wenzelm
parents: 55666
diff changeset
   576
30221
14145e81a2fe added markup for binding;
wenzelm
parents: 29522
diff changeset
   577
(** print mode operations **)
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   578
29325
a205acc94356 Markup.no_output;
wenzelm
parents: 29318
diff changeset
   579
val no_output = ("", "");
a205acc94356 Markup.no_output;
wenzelm
parents: 29318
diff changeset
   580
fun default_output (_: T) = no_output;
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   581
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   582
local
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   583
  val default = {output = default_output};
43684
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   584
  val modes = Synchronized.var "Markup.modes" (Symtab.make [("", default)]);
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   585
in
43684
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   586
  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
   587
    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
   588
      (if not (Symtab.defined tab name) then ()
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
   589
       else warning ("Redefining markup mode " ^ quote name);
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
   590
       Symtab.update (name, {output = output}) tab));
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   591
  fun get_mode () =
43684
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   592
    the_default default
85388f5570c4 prefer Synchronized.var;
wenzelm
parents: 43673
diff changeset
   593
      (Library.get_first (Symtab.lookup (Synchronized.value modes)) (print_mode_value ()));
23623
939b58b527ee Common markup elements.
wenzelm
parents:
diff changeset
   594
end;
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   595
38474
e498dc2eb576 uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents: 38429
diff changeset
   596
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
   597
23719
ccd9cb15c062 more markup for inner and outer syntax;
wenzelm
parents: 23704
diff changeset
   598
val enclose = output #-> Library.enclose;
ccd9cb15c062 more markup for inner and outer syntax;
wenzelm
parents: 23704
diff changeset
   599
25552
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   600
fun markup m =
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   601
  let val (bg, en) = output m
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   602
  in Library.enclose (Output.escape bg) (Output.escape en) end;
e4d465bc5b35 added channels;
wenzelm
parents: 24870
diff changeset
   603
43665
573d1272f36d tuned signature;
wenzelm
parents: 43593
diff changeset
   604
fun markup_only m = markup m "";
573d1272f36d tuned signature;
wenzelm
parents: 43593
diff changeset
   605
55956
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   606
fun markup_report "" = ""
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   607
  | markup_report txt = markup report txt;
94d384d621b0 reject internal term names outright, and complete consts instead;
wenzelm
parents: 55919
diff changeset
   608
23704
18d6ee425689 added print_mode setup (from pretty.ML);
wenzelm
parents: 23695
diff changeset
   609
end;