diff --git a/src/plugins/server/data.ml b/src/plugins/server/data.ml index c75c1b63d7c742285567e9b8df3462b5cbfb2105..a298e490e43ceced5223d92f7713cb087ff1d4f2 100644 --- a/src/plugins/server/data.ml +++ b/src/plugins/server/data.ml @@ -567,7 +567,7 @@ end module type Info = sig - val kind: string + val name: string end (** Simplified [Map.S] *) @@ -583,7 +583,6 @@ end module type Index = sig include S - val kind : string val get : t -> int val find : int -> t val clear : unit -> unit @@ -635,7 +634,7 @@ struct let id = Ju.to_int js in try find m id with Not_found -> - failure "[%s] No registered id #%d" I.kind id + failure "[%s] No registered id #%d" I.name id end @@ -643,7 +642,6 @@ module Static(M : Map)(I : Info) : Index with type t = M.key = struct module INDEX = INDEXER(M)(I) - let kind = I.kind let index = INDEX.create () let clear () = INDEX.clear index let get = INDEX.get index @@ -651,7 +649,7 @@ struct include (struct type t = M.key - let jtype = Jindex I.kind + let jtype = Jindex I.name let of_json = INDEX.of_json index let to_json = INDEX.to_json index end) @@ -667,17 +665,16 @@ struct type t = INDEX.index include Datatype.Undefined let reprs = [INDEX.create()] - let name = "Server.Data.Index.Type." ^ I.kind + let name = "Server.Data.Index.Type." ^ I.name let mem_project = Datatype.never_any_project end) module STATE = State_builder.Ref(TYPE) (struct - let name = "Server.Data.Index.State." ^ I.kind + let name = "Server.Data.Index.State." ^ I.name let dependencies = [] let default = INDEX.create end) - let kind = I.kind let index () = STATE.get () let clear () = INDEX.clear (index()) @@ -687,7 +684,7 @@ struct include (struct type t = M.key - let jtype = Jindex I.kind + let jtype = Jindex I.name let of_json js = INDEX.of_json (index()) js let to_json v = INDEX.to_json (index()) v end) @@ -705,21 +702,19 @@ struct type index = (int,A.t) Hashtbl.t - let kind = I.kind - module TYPE : Datatype.S with type t = index = Datatype.Make (struct type t = index include Datatype.Undefined let reprs = [Hashtbl.create 0] - let name = "Server.Data.Identified.Type." ^ I.kind + let name = "Server.Data.Identified.Type." ^ I.name let mem_project = Datatype.never_any_project end) module STATE = State_builder.Ref(TYPE) (struct - let name = "Server.Data.Identified.State." ^ I.kind + let name = "Server.Data.Identified.State." ^ I.name let dependencies = [] let default () = Hashtbl.create 0 end) @@ -733,12 +728,12 @@ struct include (struct type t = A.t - let jtype = Jindex kind + let jtype = Jindex I.name let to_json a = `Int (get a) let of_json js = let k = Ju.to_int js in try find k - with Not_found -> failure "[%s] No registered id #%d" I.kind k + with Not_found -> failure "[%s] No registered id #%d" I.name k end) end diff --git a/src/plugins/server/data.mli b/src/plugins/server/data.mli index a86c1f148881b4de715ee8cf571bf74ae7669d70..9cd4625aa81d0bd2c126be7a1eb55bc408a9deea 100644 --- a/src/plugins/server/data.mli +++ b/src/plugins/server/data.mli @@ -326,7 +326,7 @@ end (** Datatype information. *) module type Info = sig - val kind: string + val name: string end (** Simplified [Map.S]. *) @@ -343,7 +343,6 @@ end module type Index = sig include S - val kind : string val get : t -> int val find : int -> t (** @raise Not_found if not registered. *) val clear : unit -> unit