equal
deleted
inserted
replaced
312 val blobs_yxml = |
312 val blobs_yxml = |
313 { import XML.Encode._ |
313 { import XML.Encode._ |
314 val encode_blob: T[Command.Blob] = |
314 val encode_blob: T[Command.Blob] = |
315 variant(List( |
315 variant(List( |
316 { case Exn.Res((a, b)) => |
316 { case Exn.Res((a, b)) => |
317 (Nil, pair(string, option(string))((a.node, b.map(p => p._1.toString)))) }, |
317 (Nil, pair(Encode.string, option(string))((a.node, b.map(p => p._1.toString)))) }, |
318 { case Exn.Exn(e) => (Nil, string(Exn.message(e))) })) |
318 { case Exn.Exn(e) => (Nil, Encode.string(Exn.message(e))) })) |
319 |
319 |
320 YXML.string_of_body(pair(list(encode_blob), int)(command.blobs, command.blobs_index)) |
320 YXML.string_of_body(pair(list(encode_blob), int)(command.blobs, command.blobs_index)) |
321 } |
321 } |
322 |
322 |
323 val toks = command.span.content |
323 val toks = command.span.content |
370 (bool_atom(a) :: b.commands.map(cmd => long_atom(cmd.id)), |
370 (bool_atom(a) :: b.commands.map(cmd => long_atom(cmd.id)), |
371 list(pair(id, pair(Encode.string, list(Encode.string))))(c.dest)) })) |
371 list(pair(id, pair(Encode.string, list(Encode.string))))(c.dest)) })) |
372 def encode_edits: T[List[Document.Edit_Command]] = list((node_edit: Document.Edit_Command) => |
372 def encode_edits: T[List[Document.Edit_Command]] = list((node_edit: Document.Edit_Command) => |
373 { |
373 { |
374 val (name, edit) = node_edit |
374 val (name, edit) = node_edit |
375 pair(string, encode_edit(name))(name.node, edit) |
375 pair(Encode.string, encode_edit(name))(name.node, edit) |
376 }) |
376 }) |
377 YXML.string_of_body(encode_edits(edits)) } |
377 YXML.string_of_body(encode_edits(edits)) } |
378 protocol_command("Document.update", Document_ID(old_id), Document_ID(new_id), edits_yxml) |
378 protocol_command("Document.update", Document_ID(old_id), Document_ID(new_id), edits_yxml) |
379 } |
379 } |
380 |
380 |