src/Pure/PIDE/document.ML
changeset 43713 1ba5331b4623
parent 43668 aad4f1956098
child 43722 9b5dadb0c28d
equal deleted inserted replaced
43712:3c2c912af2ef 43713:1ba5331b4623
    21   val get_theory: state -> version_id -> Position.T -> string -> theory
    21   val get_theory: state -> version_id -> Position.T -> string -> theory
    22   val cancel_execution: state -> unit -> unit
    22   val cancel_execution: state -> unit -> unit
    23   val define_command: command_id -> string -> state -> state
    23   val define_command: command_id -> string -> state -> state
    24   val edit: version_id -> version_id -> edit list -> state -> (command_id * exec_id) list * state
    24   val edit: version_id -> version_id -> edit list -> state -> (command_id * exec_id) list * state
    25   val execute: version_id -> state -> state
    25   val execute: version_id -> state -> state
       
    26   val state: unit -> state
       
    27   val change_state: (state -> state) -> unit
    26 end;
    28 end;
    27 
    29 
    28 structure Document: DOCUMENT =
    30 structure Document: DOCUMENT =
    29 struct
    31 struct
    30 
    32 
   357               fold_entries NONE (fn (_, exec) => fn () => force_exec exec)
   359               fold_entries NONE (fn (_, exec) => fn () => force_exec exec)
   358                   (get_node version name) ())];
   360                   (get_node version name) ())];
   359 
   361 
   360     in (versions, commands, execs, execution') end);
   362     in (versions, commands, execs, execution') end);
   361 
   363 
   362 end;
   364 
   363 
   365 
       
   366 (** global state **)
       
   367 
       
   368 val global_state = Synchronized.var "Document" init_state;
       
   369 
       
   370 fun state () = Synchronized.value global_state;
       
   371 val change_state = Synchronized.change global_state;
       
   372 
       
   373 end;
       
   374