author | wenzelm |
Thu, 18 Jul 2013 20:53:22 +0200 | |
changeset 52697 | 6fb98a20c349 |
parent 52643 | 34c29356930e |
child 52800 | 1baa5d19ac44 |
permissions | -rw-r--r-- |
45670 | 1 |
(* Title: Pure/PIDE/markup.ML |
23623 | 2 |
Author: Makarius |
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 | 5 |
*) |
6 |
||
7 |
signature MARKUP = |
|
8 |
sig |
|
51951
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
9 |
val parse_bool: string -> bool |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
10 |
val print_bool: bool -> string |
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
11 |
val parse_int: string -> int |
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
12 |
val print_int: int -> string |
51988 | 13 |
val parse_real: string -> real |
14 |
val print_real: real -> string |
|
28017 | 15 |
type T = string * Properties.T |
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
16 |
val empty: T |
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
17 |
val is_empty: T -> bool |
38229 | 18 |
val properties: Properties.T -> T -> T |
23623 | 19 |
val nameN: string |
27818 | 20 |
val name: string -> T -> T |
38887
1261481ef5e5
Command.State: add reported positions to markup tree, according main message position or Markup.binding/entity/report occurrences in body;
wenzelm
parents:
38871
diff
changeset
|
21 |
val kindN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
22 |
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
|
23 |
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
|
24 |
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
|
25 |
val defN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
26 |
val refN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
27 |
val lineN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
28 |
val offsetN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
29 |
val end_offsetN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
30 |
val fileN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
31 |
val idN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
val pathN: string val path: string -> T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
36 |
val indentN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
37 |
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
|
38 |
val widthN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
val theoryN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
44 |
val classN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
45 |
val type_nameN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
46 |
val constantN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
47 |
val fixedN: string val fixed: string -> T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
48 |
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
|
49 |
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
|
50 |
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
|
51 |
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
|
52 |
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
|
53 |
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
|
54 |
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
|
55 |
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
|
56 |
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
|
57 |
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
|
58 |
val inner_stringN: string val inner_string: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
59 |
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
|
60 |
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
|
61 |
val sortN: string val sort: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
62 |
val typN: string val typ: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
63 |
val termN: string val term: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
64 |
val propN: string val prop: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
65 |
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
|
66 |
val typingN: string val typing: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
67 |
val ML_keywordN: string val ML_keyword: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
68 |
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
|
69 |
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
|
70 |
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
|
71 |
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
|
72 |
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
|
73 |
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
|
74 |
val ML_defN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
75 |
val ML_openN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
76 |
val ML_structN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
77 |
val ML_typingN: string val ML_typing: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
78 |
val ML_sourceN: string val ML_source: T |
51626
e09446d3caca
unified terminology with Markup.DOCUMENT_SOURCE in Scala, which is unused but displayed as "document source" entity in Isabelle/jEdit;
wenzelm
parents:
51606
diff
changeset
|
79 |
val document_sourceN: string val document_source: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
80 |
val antiqN: string val antiq: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
81 |
val ML_antiquotationN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
82 |
val document_antiquotationN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
83 |
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
|
84 |
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
|
85 |
val text_foldN: string val text_fold: T |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
86 |
val keywordN: string val keyword: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
87 |
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
|
88 |
val commandN: string val command: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
89 |
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
|
90 |
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
|
91 |
val verbatimN: string val verbatim: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
92 |
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
|
93 |
val controlN: string val control: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
94 |
val tokenN: string val token: Properties.T -> T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
95 |
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
|
96 |
val keyword2N: string val keyword2: T |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
97 |
val elapsedN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
98 |
val cpuN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
99 |
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
|
100 |
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
|
101 |
val parse_timing_properties: Properties.T -> {elapsed: Time.time, cpu: Time.time, gc: Time.time} |
51228 | 102 |
val command_timingN: string |
103 |
val command_timing_properties: |
|
104 |
{file: string, offset: int, name: string} -> Time.time -> Properties.T |
|
105 |
val parse_command_timing_properties: |
|
106 |
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
|
107 |
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
|
108 |
val subgoalsN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
109 |
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
|
110 |
val stateN: string val state: T |
50543 | 111 |
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
|
112 |
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
|
113 |
val taskN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
114 |
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
|
115 |
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
|
116 |
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
|
117 |
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
|
118 |
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
|
119 |
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
|
120 |
val serialN: string |
50914
fe4714886d92
identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents:
50845
diff
changeset
|
121 |
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
|
122 |
val initN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
123 |
val statusN: string |
50503
50f141b34bb7
enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents:
50500
diff
changeset
|
124 |
val resultN: string |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
125 |
val writelnN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
126 |
val tracingN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
127 |
val warningN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
128 |
val errorN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
129 |
val protocolN: string |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
130 |
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
|
131 |
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
|
132 |
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
|
133 |
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
|
134 |
val badN: string val bad: T |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
135 |
val intensifyN: string val intensify: T |
52643
34c29356930e
more explicit Markup.information for messages produced by "auto" tools;
wenzelm
parents:
52563
diff
changeset
|
136 |
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
|
137 |
val browserN: string |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
138 |
val graphviewN: string |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
139 |
val sendbackN: string |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
140 |
val paddingN: string |
50842 | 141 |
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
|
142 |
val padding_command: Properties.entry |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
143 |
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
|
144 |
val functionN: string |
52563 | 145 |
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
|
146 |
val removed_versions: Properties.T |
52111
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents:
51990
diff
changeset
|
147 |
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
|
148 |
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
|
149 |
val cancel_scala: string -> Properties.T |
50842 | 150 |
val ML_statistics: Properties.entry |
50975 | 151 |
val task_statistics: Properties.entry |
51216 | 152 |
val command_timing: Properties.entry |
50845 | 153 |
val loading_theory: string -> Properties.T |
154 |
val dest_loading_theory: Properties.T -> string option |
|
40131
7cbebd636e79
explicitly qualify type Output.output, which is a slightly odd internal feature;
wenzelm
parents:
39585
diff
changeset
|
155 |
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
|
156 |
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
|
157 |
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
|
158 |
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
|
159 |
val enclose: T -> Output.output -> Output.output |
25552 | 160 |
val markup: T -> string -> string |
43665 | 161 |
val markup_only: T -> string |
23623 | 162 |
end; |
163 |
||
164 |
structure Markup: MARKUP = |
|
165 |
struct |
|
166 |
||
30221 | 167 |
(** markup elements **) |
168 |
||
51988 | 169 |
(* misc values *) |
51951
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
170 |
|
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
171 |
fun parse_bool "true" = true |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
172 |
| parse_bool "false" = false |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
173 |
| parse_bool s = raise Fail ("Bad boolean: " ^ quote s); |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
174 |
|
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
175 |
val print_bool = Bool.toString; |
fab4ab92e812
more standard Isabelle/ML operations -- avoid inaccurate Bool.fromString;
wenzelm
parents:
51665
diff
changeset
|
176 |
|
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
177 |
fun parse_int s = |
43797
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
178 |
let val i = Int.fromString s in |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
179 |
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
|
180 |
then raise Fail ("Bad integer: " ^ quote s) |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
181 |
else the i |
fad7758421bf
more precise integer Markup.properties/XML.attributes: disallow ML-style ~ minus;
wenzelm
parents:
43748
diff
changeset
|
182 |
end; |
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
183 |
|
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
184 |
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
|
185 |
|
51988 | 186 |
fun parse_real s = |
187 |
(case Real.fromString s of |
|
188 |
SOME x => x |
|
189 |
| NONE => raise Fail ("Bad real: " ^ quote s)); |
|
190 |
||
51990 | 191 |
fun print_real x = |
192 |
let val s = signed_string_of_real x in |
|
193 |
(case space_explode "." s of |
|
194 |
[a, b] => if forall_string (fn c => c = "0") b then a else s |
|
195 |
| _ => s) |
|
196 |
end; |
|
51988 | 197 |
|
38414
49f1f657adc2
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
wenzelm
parents:
38229
diff
changeset
|
198 |
|
23658 | 199 |
(* basic markup *) |
23623 | 200 |
|
28017 | 201 |
type T = string * Properties.T; |
23637 | 202 |
|
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
203 |
val empty = ("", []); |
23637 | 204 |
|
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
205 |
fun is_empty ("", _) = true |
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
206 |
| is_empty _ = false; |
27883 | 207 |
|
23794 | 208 |
|
23671 | 209 |
fun properties more_props ((elem, props): T) = |
28017 | 210 |
(elem, fold_rev Properties.put more_props props); |
23671 | 211 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
212 |
fun markup_elem elem = (elem, (elem, []): T); |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
213 |
fun markup_string elem prop = (elem, fn s => (elem, [(prop, s)]): T); |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
214 |
fun markup_int elem prop = (elem, fn i => (elem, [(prop, print_int i)]): T); |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
215 |
|
26977 | 216 |
|
38721
ca8b14fa0d0d
added some proof state markup, notably number of subgoals (e.g. for indentation);
wenzelm
parents:
38474
diff
changeset
|
217 |
(* misc properties *) |
26977 | 218 |
|
23658 | 219 |
val nameN = "name"; |
27818 | 220 |
fun name a = properties [(nameN, a)]; |
221 |
||
23658 | 222 |
val kindN = "kind"; |
23671 | 223 |
|
23658 | 224 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
225 |
(* formal entities *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
226 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
227 |
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
|
228 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
229 |
val entityN = "entity"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
230 |
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
|
231 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
232 |
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
|
233 |
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
|
234 |
else NONE; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
235 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
236 |
val defN = "def"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
237 |
val refN = "ref"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
238 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
239 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
240 |
(* position *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
241 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
242 |
val lineN = "line"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
243 |
val offsetN = "offset"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
244 |
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
|
245 |
val fileN = "file"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
246 |
val idN = "id"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
247 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
248 |
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
|
249 |
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
|
250 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
251 |
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
|
252 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
253 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
254 |
(* path *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
255 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
256 |
val (pathN, path) = markup_string "path" nameN; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
257 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
258 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
259 |
(* pretty printing *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
260 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
261 |
val indentN = "indent"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
262 |
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
|
263 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
264 |
val widthN = "width"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
265 |
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
|
266 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
267 |
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
|
268 |
|
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
|
269 |
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
|
270 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
271 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
272 |
(* hidden text *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
273 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
274 |
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
|
275 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
276 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
277 |
(* logical entities *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
278 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
279 |
val theoryN = "theory"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
280 |
val classN = "class"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
281 |
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
|
282 |
val constantN = "constant"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
283 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
284 |
val (fixedN, fixed) = markup_string "fixed" nameN; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
285 |
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
|
286 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
287 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
288 |
(* inner syntax *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
289 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
290 |
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
|
291 |
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
|
292 |
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
|
293 |
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
|
294 |
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
|
295 |
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
|
296 |
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
|
297 |
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
|
298 |
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
|
299 |
val (inner_stringN, inner_string) = markup_elem "inner_string"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
300 |
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
|
301 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
302 |
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
|
303 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
304 |
val (sortN, sort) = markup_elem "sort"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
305 |
val (typN, typ) = markup_elem "typ"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
306 |
val (termN, term) = markup_elem "term"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
307 |
val (propN, prop) = markup_elem "prop"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
308 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
309 |
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
|
310 |
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
|
311 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
312 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
313 |
(* ML syntax *) |
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 (ML_keywordN, ML_keyword) = markup_elem "ML_keyword"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
316 |
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
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
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
|
322 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
323 |
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
|
324 |
val ML_openN = "ML_open"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
325 |
val ML_structN = "ML_struct"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
326 |
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
|
327 |
|
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 |
(* embedded source text *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
330 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
331 |
val (ML_sourceN, ML_source) = markup_elem "ML_source"; |
51626
e09446d3caca
unified terminology with Markup.DOCUMENT_SOURCE in Scala, which is unused but displayed as "document source" entity in Isabelle/jEdit;
wenzelm
parents:
51606
diff
changeset
|
332 |
val (document_sourceN, document_source) = markup_elem "document_source"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
333 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
334 |
val (antiqN, antiq) = markup_elem "antiq"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
335 |
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
|
336 |
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
|
337 |
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
|
338 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
339 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
340 |
(* text structure *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
341 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
342 |
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
|
343 |
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
|
344 |
|
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 |
(* outer syntax *) |
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 (keywordN, keyword) = markup_elem "keyword"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
349 |
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
|
350 |
val (commandN, command) = markup_elem "command"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
351 |
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
|
352 |
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
|
353 |
val (verbatimN, verbatim) = markup_elem "verbatim"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
354 |
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
|
355 |
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
|
356 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
357 |
val tokenN = "token"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
358 |
fun token props = (tokenN, props); |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
359 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
360 |
val (keyword1N, keyword1) = markup_elem "keyword1"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
361 |
val (keyword2N, keyword2) = markup_elem "keyword2"; |
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 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
364 |
(* timing *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
365 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
366 |
val elapsedN = "elapsed"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
367 |
val cpuN = "cpu"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
368 |
val gcN = "gc"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
369 |
|
50781 | 370 |
fun timing_properties {elapsed, cpu, gc} = |
371 |
[(elapsedN, Time.toString elapsed), |
|
372 |
(cpuN, Time.toString cpu), |
|
373 |
(gcN, Time.toString gc)]; |
|
374 |
||
51665 | 375 |
fun parse_timing_properties props = |
376 |
{elapsed = Properties.seconds props elapsedN, |
|
377 |
cpu = Properties.seconds props cpuN, |
|
378 |
gc = Properties.seconds props gcN}; |
|
51218
6425a0d3b7ac
support for build passing timings from Scala to ML;
wenzelm
parents:
51217
diff
changeset
|
379 |
|
51665 | 380 |
val timingN = "timing"; |
381 |
fun timing t = (timingN, timing_properties t); |
|
51218
6425a0d3b7ac
support for build passing timings from Scala to ML;
wenzelm
parents:
51217
diff
changeset
|
382 |
|
51228 | 383 |
|
384 |
(* command timing *) |
|
385 |
||
386 |
val command_timingN = "command_timing"; |
|
387 |
||
388 |
fun command_timing_properties {file, offset, name} elapsed = |
|
389 |
[(fileN, file), (offsetN, print_int offset), |
|
390 |
(nameN, name), (elapsedN, Time.toString elapsed)]; |
|
391 |
||
392 |
fun parse_command_timing_properties props = |
|
393 |
(case (Properties.get props fileN, Properties.get props offsetN, Properties.get props nameN) of |
|
394 |
(SOME file, SOME offset, SOME name) => |
|
51665 | 395 |
SOME ({file = file, offset = parse_int offset, name = name}, |
396 |
Properties.seconds props elapsedN) |
|
51228 | 397 |
| _ => NONE); |
398 |
||
399 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
400 |
(* toplevel *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
401 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
402 |
val subgoalsN = "subgoals"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
403 |
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
|
404 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
405 |
val (stateN, state) = markup_elem "state"; |
50543 | 406 |
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
|
407 |
val (subgoalN, subgoal) = markup_string "subgoal" nameN; |
50215 | 408 |
|
50450
358b6020f8b6
generalized notion of active area, where sendback is just one application;
wenzelm
parents:
50255
diff
changeset
|
409 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
410 |
(* command status *) |
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 |
val taskN = "task"; |
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 (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
|
415 |
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
|
416 |
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
|
417 |
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
|
418 |
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
|
419 |
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
|
420 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
421 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
422 |
(* messages *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
423 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
424 |
val serialN = "serial"; |
50914
fe4714886d92
identify future results more carefully, to avoid odd duplication of error messages, notably from forked goals;
wenzelm
parents:
50845
diff
changeset
|
425 |
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
|
426 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
427 |
val initN = "init"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
428 |
val statusN = "status"; |
50503
50f141b34bb7
enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents:
50500
diff
changeset
|
429 |
val resultN = "result"; |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
430 |
val writelnN = "writeln"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
431 |
val tracingN = "tracing"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
432 |
val warningN = "warning"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
433 |
val errorN = "error"; |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
434 |
val protocolN = "protocol"; |
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 |
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
|
437 |
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
|
438 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
439 |
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
|
440 |
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
|
441 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
442 |
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
|
443 |
|
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
444 |
val (intensifyN, intensify) = markup_elem "intensify"; |
52643
34c29356930e
more explicit Markup.information for messages produced by "auto" tools;
wenzelm
parents:
52563
diff
changeset
|
445 |
val (informationN, information) = markup_elem "information"; |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
446 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
447 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
448 |
(* active areas *) |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
449 |
|
50715
8cfd585b9162
prefer old graph browser in Isabelle/jEdit, which still produces better layout;
wenzelm
parents:
50683
diff
changeset
|
450 |
val browserN = "browser" |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
451 |
val graphviewN = "graphview"; |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
452 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
453 |
val sendbackN = "sendback"; |
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
454 |
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
|
455 |
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
|
456 |
val padding_command = (paddingN, "command"); |
50500
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
457 |
|
c94bba7906d2
identify dialogs via official serial and maintain as result message;
wenzelm
parents:
50499
diff
changeset
|
458 |
val dialogN = "dialog"; |
50503
50f141b34bb7
enable Isabelle/ML to produce uninterpreted result messages as well;
wenzelm
parents:
50500
diff
changeset
|
459 |
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
|
460 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
461 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
462 |
(* protocol message functions *) |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
463 |
|
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
464 |
val functionN = "function" |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
465 |
|
52563 | 466 |
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
|
467 |
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
|
468 |
|
52111
1fd184eaa310
explicit management of Session.Protocol_Handlers, with protocol state and functions;
wenzelm
parents:
51990
diff
changeset
|
469 |
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
|
470 |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
471 |
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
|
472 |
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
|
473 |
|
50683 | 474 |
val ML_statistics = (functionN, "ML_statistics"); |
50255 | 475 |
|
50975 | 476 |
val task_statistics = (functionN, "task_statistics"); |
477 |
||
51216 | 478 |
val command_timing = (functionN, "command_timing"); |
479 |
||
50845 | 480 |
fun loading_theory name = [("function", "loading_theory"), ("name", name)]; |
481 |
||
482 |
fun dest_loading_theory [("function", "loading_theory"), ("name", name)] = SOME name |
|
483 |
| dest_loading_theory _ = NONE; |
|
484 |
||
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
46894
diff
changeset
|
485 |
|
27969 | 486 |
|
30221 | 487 |
(** print mode operations **) |
23704 | 488 |
|
29325 | 489 |
val no_output = ("", ""); |
490 |
fun default_output (_: T) = no_output; |
|
23704 | 491 |
|
492 |
local |
|
493 |
val default = {output = default_output}; |
|
43684 | 494 |
val modes = Synchronized.var "Markup.modes" (Symtab.make [("", default)]); |
23704 | 495 |
in |
43684 | 496 |
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
|
497 |
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
|
498 |
(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
|
499 |
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
|
500 |
Symtab.update (name, {output = output}) tab)); |
23704 | 501 |
fun get_mode () = |
43684 | 502 |
the_default default |
503 |
(Library.get_first (Symtab.lookup (Synchronized.value modes)) (print_mode_value ())); |
|
23623 | 504 |
end; |
23704 | 505 |
|
38474
e498dc2eb576
uniform Markup.empty/Markup.Empty in ML and Scala;
wenzelm
parents:
38429
diff
changeset
|
506 |
fun output m = if is_empty m then no_output else #output (get_mode ()) m; |
23704 | 507 |
|
23719 | 508 |
val enclose = output #-> Library.enclose; |
509 |
||
25552 | 510 |
fun markup m = |
511 |
let val (bg, en) = output m |
|
512 |
in Library.enclose (Output.escape bg) (Output.escape en) end; |
|
513 |
||
43665 | 514 |
fun markup_only m = markup m ""; |
515 |
||
23704 | 516 |
end; |