src/Pure/PIDE/document.ML
author wenzelm
Sat, 14 Aug 2010 22:45:23 +0200
changeset 38660 49f1f657adc2
parent 38655 e8197eea3cd0
child 38677 9a7af64d71bb
permissions -rw-r--r--
more basic Markup.parse_int/print_int (using signed_string_of_int) (ML);
added convenient Markup.Int/Long objects (Scala);
simplified "assign" message format -- explicit version id;
misc tuning and simplification;
     1 (*  Title:      Pure/PIDE/document.ML
     2     Author:     Makarius
     3 
     4 Document as collection of named nodes, each consisting of an editable
     5 list of commands.
     6 *)
     7 
     8 signature DOCUMENT =
     9 sig
    10   type id = int
    11   type version_id = id
    12   type command_id = id
    13   type exec_id = id
    14   val no_id: id
    15   val parse_id: string -> id
    16   val print_id: id -> string
    17   type edit = string * ((command_id * command_id option) list) option
    18 end;
    19 
    20 structure Document: DOCUMENT =
    21 struct
    22 
    23 (* unique identifiers *)
    24 
    25 type id = int;
    26 type version_id = id;
    27 type command_id = id;
    28 type exec_id = id;
    29 
    30 val no_id = 0;
    31 
    32 val parse_id = Markup.parse_int;
    33 val print_id = Markup.print_int;
    34 
    35 
    36 (* edits *)
    37 
    38 type edit =
    39   string *  (*node name*)
    40   ((command_id * command_id option) list) option;  (*NONE: remove, SOME: insert/remove commands*)
    41 
    42 end;
    43