src/Pure/PIDE/document_id.ML
changeset 52530 99dd8b4ef3fe
child 52531 21f8e0e151f5
equal deleted inserted replaced
52528:b6a224676c04 52530:99dd8b4ef3fe
       
     1 (*  Title:      Pure/PIDE/document_id.ML
       
     2     Author:     Makarius
       
     3 
       
     4 Unique identifiers for document structure.
       
     5 
       
     6 NB: ML ticks forwards > 0, JVM ticks backwards < 0.
       
     7 *)
       
     8 
       
     9 signature DOCUMENT_ID =
       
    10 sig
       
    11   type id = int
       
    12   type version = id
       
    13   type command = id
       
    14   type exec = id
       
    15   val none: id
       
    16   val make: unit -> id
       
    17   val parse: string -> id
       
    18   val print: id -> string
       
    19 end;
       
    20 
       
    21 structure Document_ID: DOCUMENT_ID =
       
    22 struct
       
    23 
       
    24 type id = int;
       
    25 type version = id;
       
    26 type command = id;
       
    27 type exec = id;
       
    28 
       
    29 val none = 0;
       
    30 val make = Synchronized.counter ();
       
    31 
       
    32 val parse = Markup.parse_int;
       
    33 val print = Markup.print_int;
       
    34 
       
    35 end;
       
    36