227 (name, Document.Node.Edits(cmd_edits)) <- doc_edits // FIXME proper coverage!? |
227 (name, Document.Node.Edits(cmd_edits)) <- doc_edits // FIXME proper coverage!? |
228 (prev, None) <- cmd_edits |
228 (prev, None) <- cmd_edits |
229 removed <- previous.nodes(name).commands.get_after(prev) |
229 removed <- previous.nodes(name).commands.get_after(prev) |
230 } former_assignment -= removed |
230 } former_assignment -= removed |
231 |
231 |
232 def id_command(command: Command): Document.Command_ID = |
232 def id_command(command: Command) |
233 { |
233 { |
234 if (global_state().lookup_command(command.id).isEmpty) { |
234 if (global_state().lookup_command(command.id).isEmpty) { |
235 global_state.change(_.define_command(command)) |
235 global_state.change(_.define_command(command)) |
236 prover.get.define_command(command.id, Symbol.encode(command.source)) |
236 prover.get.define_command(command.id, Symbol.encode(command.source)) |
237 } |
237 } |
238 command.id |
238 } |
239 } |
239 doc_edits foreach { |
240 val id_edits = |
240 case (_, edit) => |
241 doc_edits map { |
241 edit foreach { case (c1, c2) => c1 foreach id_command; c2 foreach id_command } |
242 case (name, edit) => |
242 } |
243 (name, edit.map({ case (c1, c2) => (c1.map(id_command), c2.map(id_command)) })) |
|
244 } |
|
245 |
243 |
246 global_state.change(_.define_version(version, former_assignment)) |
244 global_state.change(_.define_version(version, former_assignment)) |
247 prover.get.edit_version(previous.id, version.id, id_edits) |
245 prover.get.edit_version(previous.id, version.id, doc_edits) |
248 } |
246 } |
249 //}}} |
247 //}}} |
250 |
248 |
251 |
249 |
252 /* prover results */ |
250 /* prover results */ |