Permalink
Browse files

Show warnings when names are reused

  • Loading branch information...
1 parent 2e211ba commit 6b2bd36d588fb43f46b3e50b0b40c99e0e22c8b5 @VictorNicollet committed Oct 26, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 ohmCouchRegistry/ohmCouchRegistry.ml
View
7 ohmCouchRegistry/ohmCouchRegistry.ml
@@ -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 }

0 comments on commit 6b2bd36

Please sign in to comment.