Skip to content

Commit

Permalink
Show warnings when names are reused
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorNicollet committed Oct 26, 2012
1 parent 2e211ba commit 6b2bd36
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ohmCouchRegistry/ohmCouchRegistry.ml
Expand Up @@ -42,12 +42,19 @@ module Make = functor(R:REGISTRY_CONFIG) -> struct
module Db = CouchDB.Database(R.Store)
module Tbl = CouchDB.Table(Db)(Id)(Entry)

let reserved = Hashtbl.create 100

type 'a property = {
fmt : 'a Fmt.t ;
suffix : string ;
}

let property fmt name =
begin
try Hashtbl.find reserved name ;
Util.log "Property %s is already reserved !" name ;
with Not_found -> Hashtbl.add reserved name ()
end ;
let suffix = "." ^ String.concat ".." (BatString.nsplit name ".") in
{ fmt ; suffix }

Expand Down

0 comments on commit 6b2bd36

Please sign in to comment.