author | wenzelm |
Wed, 31 May 2000 14:29:42 +0200 | |
changeset 9010 | ce78dc5e1a73 |
parent 8990 | 19956dd3809e |
child 9050 | 578730810638 |
permissions | -rw-r--r-- |
6699 | 1 |
(* Title: Pure/Interface/proof_general.ML |
2 |
ID: $Id$ |
|
3 |
Author: Markus Wenzel, TU Muenchen |
|
4 |
||
7266 | 5 |
Configuration for Proof General of LFCS Edinburgh. |
6699 | 6 |
*) |
7 |
||
8 |
signature PROOF_GENERAL = |
|
9 |
sig |
|
10 |
val setup: (theory -> theory) list |
|
7954 | 11 |
val update_thy_only: string -> unit |
12 |
val try_update_thy_only: string -> unit |
|
13 |
val inform_file_processed: string -> unit |
|
14 |
val inform_file_retracted: string -> unit |
|
7579 | 15 |
val thms_containing: xstring list -> unit |
7193 | 16 |
val help: unit -> unit |
17 |
val show_context: unit -> theory |
|
18 |
val kill_goal: unit -> unit |
|
19 |
val repeat_undo: int -> unit |
|
7235 | 20 |
val isa_restart: unit -> unit |
6699 | 21 |
val init: bool -> unit |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
22 |
val write_keywords: unit -> unit |
6699 | 23 |
end; |
24 |
||
25 |
structure ProofGeneral: PROOF_GENERAL = |
|
26 |
struct |
|
27 |
||
28 |
(** compile-time theory setup **) |
|
29 |
||
30 |
(* token translations *) |
|
31 |
||
32 |
val proof_generalN = "ProofGeneral"; |
|
33 |
||
34 |
local |
|
35 |
||
36 |
val end_tag = oct_char "350"; |
|
37 |
val tclass_tag = oct_char "351"; |
|
38 |
val tfree_tag = oct_char "352"; |
|
39 |
val tvar_tag = oct_char "353"; |
|
40 |
val free_tag = oct_char "354"; |
|
41 |
val bound_tag = oct_char "355"; |
|
42 |
val var_tag = oct_char "356"; |
|
7597 | 43 |
val skolem_tag = oct_char "357"; |
6699 | 44 |
|
8331 | 45 |
fun tagit p x = (p ^ x ^ end_tag, real (Symbol.length (Symbol.explode x))); |
6699 | 46 |
|
8270 | 47 |
fun unless_skolem tag x = |
7597 | 48 |
(case try Syntax.dest_skolem x of |
8270 | 49 |
None => tagit tag x |
7597 | 50 |
| Some x' => tagit skolem_tag x'); |
51 |
||
6699 | 52 |
in |
53 |
||
54 |
val proof_general_trans = |
|
55 |
Syntax.tokentrans_mode proof_generalN |
|
56 |
[("class", tagit tclass_tag), |
|
57 |
("tfree", tagit tfree_tag), |
|
58 |
("tvar", tagit tvar_tag), |
|
8270 | 59 |
("free", unless_skolem free_tag), |
6699 | 60 |
("bound", tagit bound_tag), |
8270 | 61 |
("var", unless_skolem var_tag)]; |
6699 | 62 |
|
63 |
end; |
|
64 |
||
65 |
||
66 |
(* setup *) |
|
67 |
||
68 |
val setup = [Theory.add_tokentrfuns proof_general_trans]; |
|
69 |
||
70 |
||
71 |
||
7193 | 72 |
(** run-time operations **) |
6699 | 73 |
|
8445 | 74 |
(* symbol output *) |
75 |
||
76 |
fun xsymbols_output s = |
|
77 |
if not (exists_string (equal "\\") s) then (s, real (size s)) |
|
78 |
else |
|
79 |
let val syms = Symbol.explode s |
|
80 |
in (implode (map (fn "\\" => "\\\\" | c => c) syms), real (Symbol.length syms)) end; |
|
81 |
||
82 |
fun setup_xsymbols_output () = Symbol.add_mode "xsymbols" xsymbols_output; |
|
83 |
||
84 |
||
6699 | 85 |
(* messages *) |
86 |
||
7193 | 87 |
val plain_output = std_output o suffix "\n"; |
7195 | 88 |
fun plain_writeln x = Library.setmp writeln_fn plain_output x; |
7193 | 89 |
|
90 |
fun decorate_lines bg en "" = plain_output o enclose bg en |
|
91 |
| decorate_lines bg en prfx = plain_output o enclose bg en o prefix_lines prfx; |
|
6699 | 92 |
|
93 |
fun setup_messages () = |
|
94 |
(writeln_fn := (decorate_lines (oct_char "360") (oct_char "361") ""); |
|
95 |
warning_fn := (decorate_lines (oct_char "362") (oct_char "363") "### "); |
|
96 |
error_fn := (decorate_lines (oct_char "364") (oct_char "365") "*** ")); |
|
97 |
||
98 |
||
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
99 |
(* notification *) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
100 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
101 |
fun tell_clear_goals () = writeln "Proof General, please clear the goals buffer."; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
102 |
fun tell_clear_response () = writeln "Proof General, please clear the response buffer."; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
103 |
fun tell_file msg path = writeln ("Proof General, " ^ msg ^ " " ^ quote (File.sysify_path path)); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
104 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
105 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
106 |
(* theory / proof state output *) |
6699 | 107 |
|
7193 | 108 |
fun print_current_goals n max th = plain_writeln (Goals.print_current_goals_default n max) th; |
109 |
||
7939 | 110 |
fun setup_state () = |
111 |
(current_goals_markers := |
|
6699 | 112 |
let |
113 |
val begin_state = oct_char "366"; |
|
114 |
val end_state= oct_char "367"; |
|
8495
4f5a3272c8ba
no begin_goal marker (interferes with "latex" etc. output; useless anyway?)
wenzelm
parents:
8452
diff
changeset
|
115 |
in (begin_state, end_state, "") end; |
8886 | 116 |
Toplevel.print_state_fn := (fn x => fn y => |
117 |
plain_writeln (fn () => Toplevel.print_state_default x y) ()); |
|
7939 | 118 |
Toplevel.prompt_state_fn := (suffix (oct_char "372") o Toplevel.prompt_state_default); |
119 |
Goals.print_current_goals_fn := print_current_goals); |
|
6699 | 120 |
|
121 |
||
7100 | 122 |
(* theory loader actions *) |
123 |
||
124 |
local |
|
125 |
||
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
126 |
fun add_master_files name files = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
127 |
let val masters = [ThyLoad.thy_path name, ThyLoad.ml_path name] |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
128 |
in masters @ gen_rems (op = o pairself Path.base) (files, masters) end; |
7100 | 129 |
|
7893 | 130 |
fun trace_action action name = |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
131 |
if action = ThyInfo.Update then |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
132 |
seq (tell_file "this file is loaded:") (ThyInfo.loaded_files name) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
133 |
else if action = ThyInfo.Outdate orelse action = ThyInfo.Remove then |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
134 |
seq (tell_file "you can unlock the file") (add_master_files name (ThyInfo.loaded_files name)) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
135 |
else (); |
7193 | 136 |
|
7100 | 137 |
in |
7893 | 138 |
fun setup_thy_loader () = ThyInfo.add_hook trace_action; |
7100 | 139 |
end; |
140 |
||
141 |
||
7954 | 142 |
(* prepare theory context *) |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
143 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
144 |
val thy_name = Path.pack o Path.drop_ext o Path.base o Path.unpack; |
7954 | 145 |
val update_thy_only = ThyInfo.update_thy_only; |
146 |
||
147 |
fun which_context () = |
|
148 |
(case Context.get_context () of |
|
149 |
Some thy => " Using current (dynamic!) one: " ^ |
|
7956 | 150 |
(case try PureThy.get_name thy of Some name => quote name | None => "<unnamed>") |
7954 | 151 |
| None => ""); |
152 |
||
153 |
fun try_update_thy_only file = |
|
154 |
ThyLoad.cond_with_path (Path.dir (Path.unpack file)) (fn () => |
|
155 |
let val name = thy_name file in |
|
156 |
if is_some (ThyLoad.check_file (ThyLoad.thy_path name)) then update_thy_only name |
|
157 |
else warning ("Unkown theory context of ML file." ^ which_context ()) |
|
158 |
end) (); |
|
159 |
||
160 |
||
161 |
(* get informed about files *) |
|
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
162 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
163 |
(* FIXME improve, e.g. do something like pretend_use_thy *) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
164 |
fun inform_file_processed file = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
165 |
ThyInfo.if_known_thy ThyInfo.touch_child_thys (thy_name file); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
166 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
167 |
fun inform_file_retracted file = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
168 |
ThyInfo.if_known_thy ThyInfo.touch_child_thys (thy_name file); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
169 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
170 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
171 |
(* misc commands for ProofGeneral/isa *) |
7193 | 172 |
|
7610 | 173 |
fun thms_containing cs = ThmDatabase.print_thms_containing (the_context ()) cs; |
7579 | 174 |
|
7193 | 175 |
val help = writeln o Session.welcome; |
176 |
val show_context = Context.the_context; |
|
177 |
||
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
178 |
fun kill_goal () = (Goals.reset_goals (); tell_clear_goals ()); |
7193 | 179 |
|
7922 | 180 |
fun no_print_goals f = setmp print_current_goals_fn (fn _ => fn _ => fn _ => ()) f; |
181 |
||
7193 | 182 |
fun repeat_undo 0 = () |
7922 | 183 |
| repeat_undo 1 = undo () |
184 |
| repeat_undo n = (no_print_goals undo (); repeat_undo (n - 1)); |
|
7193 | 185 |
|
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
186 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
187 |
(* re-init process (an approximation) *) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
188 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
189 |
local |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
190 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
191 |
fun restart isar = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
192 |
(ThyInfo.touch_all_thys (); |
7939 | 193 |
if isar then tell_clear_goals () else kill_goal (); |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
194 |
tell_clear_response (); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
195 |
writeln (Session.welcome ())); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
196 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
197 |
in |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
198 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
199 |
fun isa_restart () = restart false; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
200 |
fun isar_restart () = (restart true; raise Toplevel.RESTART); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
201 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
202 |
end; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
203 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
204 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
205 |
(* outer syntax *) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
206 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
207 |
local structure P = OuterParse and K = OuterSyntax.Keyword in |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
208 |
|
8647 | 209 |
val old_undoP = (* FIXME same name for compatibility with PG/Isabelle99 *) |
8452 | 210 |
OuterSyntax.improper_command "undo" "undo last command (no output)" K.control |
9010 | 211 |
(Scan.succeed (Toplevel.no_timing o IsarCmd.undo)); |
8452 | 212 |
|
8647 | 213 |
val undoP = |
214 |
OuterSyntax.improper_command "ProofGeneral.undo" "undo last command (no output)" K.control |
|
9010 | 215 |
(Scan.succeed (Toplevel.no_timing o IsarCmd.undo)); |
8647 | 216 |
|
7954 | 217 |
val context_thy_onlyP = |
218 |
OuterSyntax.improper_command "ProofGeneral.context_thy_only" "(internal)" K.control |
|
9010 | 219 |
(P.name >> (Toplevel.no_timing oo IsarThy.init_context update_thy_only)); |
7954 | 220 |
|
221 |
val try_context_thy_onlyP = |
|
222 |
OuterSyntax.improper_command "ProofGeneral.try_context_thy_only" "(internal)" K.control |
|
9010 | 223 |
(P.name >> (Toplevel.no_timing oo |
224 |
(Toplevel.imperative (K ()) oo IsarThy.init_context try_update_thy_only))); |
|
7954 | 225 |
|
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
226 |
val restartP = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
227 |
OuterSyntax.improper_command "ProofGeneral.restart" "(internal)" K.control |
9010 | 228 |
(P.opt_unit >> (Toplevel.no_timing oo K (Toplevel.imperative isar_restart))); |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
229 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
230 |
val kill_proofP = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
231 |
OuterSyntax.improper_command "ProofGeneral.kill_proof" "(internal)" K.control |
9010 | 232 |
(Scan.succeed (Toplevel.no_timing o IsarCmd.kill_proof_notify tell_clear_goals)); |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
233 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
234 |
val inform_file_processedP = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
235 |
OuterSyntax.improper_command "ProofGeneral.inform_file_processed" "(internal)" K.control |
9010 | 236 |
(P.name >> (Toplevel.no_timing oo |
237 |
(fn name => Toplevel.imperative (fn () => inform_file_processed name)))); |
|
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
238 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
239 |
val inform_file_retractedP = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
240 |
OuterSyntax.improper_command "ProofGeneral.inform_file_retracted" "(internal)" K.control |
9010 | 241 |
(P.name >> (Toplevel.no_timing oo |
242 |
(fn name => Toplevel.imperative (fn () => inform_file_retracted name)))); |
|
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
243 |
|
7954 | 244 |
fun init_outer_syntax () = OuterSyntax.add_parsers |
8647 | 245 |
[old_undoP, undoP, restartP, kill_proofP, context_thy_onlyP, try_context_thy_onlyP, |
7954 | 246 |
inform_file_processedP, inform_file_retractedP]; |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
247 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
248 |
end; |
7193 | 249 |
|
250 |
||
6699 | 251 |
(* init *) |
252 |
||
253 |
fun init isar = |
|
8668 | 254 |
(if isar then setmp warning_fn (K ()) init_outer_syntax () else (); |
8452 | 255 |
setup_xsymbols_output (); |
8445 | 256 |
setup_messages (); |
7939 | 257 |
setup_state (); |
7893 | 258 |
setup_thy_loader (); |
7330 | 259 |
print_mode := [proof_generalN]; |
6699 | 260 |
set quick_and_dirty; |
7939 | 261 |
ml_prompts ("> " ^ oct_char "372") ("- " ^ oct_char "373"); |
7193 | 262 |
if isar then Isar.sync_main () else isa_restart ()); |
6699 | 263 |
|
264 |
||
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
265 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
266 |
(** generate keyword classification file **) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
267 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
268 |
local |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
269 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
270 |
val regexp_meta = explode ".*+?[]^$"; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
271 |
val regexp_quote = implode o map (fn c => if c mem regexp_meta then "\\\\" ^ c else c) o explode; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
272 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
273 |
fun defconst name strs = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
274 |
"\n(defconst isar-keywords-" ^ name ^ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
275 |
"\n '(" ^ space_implode "\n " (map (quote o regexp_quote) strs) ^ "))\n"; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
276 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
277 |
fun make_elisp_commands commands kind = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
278 |
defconst kind (mapfilter (fn (c, _, k, _) => if k = kind then Some c else None) commands); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
279 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
280 |
fun make_elisp_syntax (keywords, commands) = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
281 |
";;\n\ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
282 |
\;; Keyword classification tables for Isabelle/Isar.\n\ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
283 |
\;; This file generated by Isabelle -- DO NOT EDIT!\n\ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
284 |
\;;\n\ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
285 |
\;; $" ^ "Id$\n\ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
286 |
\;;\n" ^ |
8990 | 287 |
defconst "major" (map #1 commands) ^ |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
288 |
defconst "minor" (filter Syntax.is_identifier keywords) ^ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
289 |
implode (map (make_elisp_commands commands) OuterSyntax.Keyword.kinds) ^ |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
290 |
"\n(provide 'isar-keywords)\n"; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
291 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
292 |
val keywords_file = "isar-keywords.el"; |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
293 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
294 |
in |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
295 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
296 |
fun write_keywords () = |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
297 |
(init_outer_syntax (); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
298 |
File.write (Path.unpack keywords_file) |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
299 |
(make_elisp_syntax (OuterSyntax.dest_keywords (), OuterSyntax.dest_parsers ()))); |
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
300 |
|
6699 | 301 |
end; |
7937
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
302 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
303 |
|
82025fe607d3
added inform_file_processed, inform_file_retracted;
wenzelm
parents:
7922
diff
changeset
|
304 |
end; |