equal
deleted
inserted
replaced
9 sig |
9 sig |
10 val timing: bool Unsynchronized.ref |
10 val timing: bool Unsynchronized.ref |
11 type node_header = string * Thy_Header.header * string list |
11 type node_header = string * Thy_Header.header * string list |
12 type overlay = Document_ID.command * (string * string list) |
12 type overlay = Document_ID.command * (string * string list) |
13 datatype node_edit = |
13 datatype node_edit = |
14 Clear | (* FIXME unused !? *) |
|
15 Edits of (Document_ID.command option * Document_ID.command option) list | |
14 Edits of (Document_ID.command option * Document_ID.command option) list | |
16 Deps of node_header | |
15 Deps of node_header | |
17 Perspective of bool * Document_ID.command list * overlay list |
16 Perspective of bool * Document_ID.command list * overlay list |
18 type edit = string * node_edit |
17 type edit = string * node_edit |
19 type state |
18 type state |
74 |
73 |
75 val no_header = ("", Thy_Header.make ("", Position.none) [] [], ["No theory header"]); |
74 val no_header = ("", Thy_Header.make ("", Position.none) [] [], ["No theory header"]); |
76 val no_perspective = make_perspective (false, [], []); |
75 val no_perspective = make_perspective (false, [], []); |
77 |
76 |
78 val empty_node = make_node (no_header, no_perspective, Entries.empty, NONE); |
77 val empty_node = make_node (no_header, no_perspective, Entries.empty, NONE); |
79 val clear_node = map_node (fn (header, _, _, _) => (header, no_perspective, Entries.empty, NONE)); |
|
80 |
78 |
81 |
79 |
82 (* basic components *) |
80 (* basic components *) |
83 |
81 |
84 fun master_directory (Node {header = (master, _, _), ...}) = |
82 fun master_directory (Node {header = (master, _, _), ...}) = |
143 (* node edits and associated executions *) |
141 (* node edits and associated executions *) |
144 |
142 |
145 type overlay = Document_ID.command * (string * string list); |
143 type overlay = Document_ID.command * (string * string list); |
146 |
144 |
147 datatype node_edit = |
145 datatype node_edit = |
148 Clear | |
|
149 Edits of (Document_ID.command option * Document_ID.command option) list | |
146 Edits of (Document_ID.command option * Document_ID.command option) list | |
150 Deps of node_header | |
147 Deps of node_header | |
151 Perspective of bool * Document_ID.command list * overlay list; |
148 Perspective of bool * Document_ID.command list * overlay list; |
152 |
149 |
153 type edit = string * node_edit; |
150 type edit = string * node_edit; |
191 fun cycle_msg names = "Cyclic dependency of " ^ space_implode " via " (map quote names); |
188 fun cycle_msg names = "Cyclic dependency of " ^ space_implode " via " (map quote names); |
192 |
189 |
193 fun edit_nodes (name, node_edit) (Version nodes) = |
190 fun edit_nodes (name, node_edit) (Version nodes) = |
194 Version |
191 Version |
195 (case node_edit of |
192 (case node_edit of |
196 Clear => update_node name clear_node nodes |
193 Edits edits => update_node name (edit_node edits) nodes |
197 | Edits edits => update_node name (edit_node edits) nodes |
|
198 | Deps (master, header, errors) => |
194 | Deps (master, header, errors) => |
199 let |
195 let |
200 val imports = map fst (#imports header); |
196 val imports = map fst (#imports header); |
201 val errors1 = |
197 val errors1 = |
202 (Thy_Header.define_keywords header; errors) |
198 (Thy_Header.define_keywords header; errors) |