123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475(*
* Copyright (c) 2014 Leo White <leo@lpw25.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)letcontains_double_underscores=letlen=String.lengthsinletrecauxi=ifi>len-2thenfalseelseifs.[i]='_'&&s.[i+1]='_'thentrueelseaux(i+1)inaux0modulePackage=structtypet=stringmoduleTable=Hashtbl.Make(structtypenonrect=tletequal:t->t->bool=(=)lethash:t->int=Hashtbl.hashend)endmoduleOdoc_file=structtypecompilation_unit={name:string;hidden:bool}typet=|Pageofstring|Compilation_unitofcompilation_unitletcreate_unit~force_hiddenname=lethidden=force_hidden||contains_double_underscorenameinCompilation_unit{name;hidden}letcreate_pagename=Pagenameletname=function|Pagename|Compilation_unit{name;_}->nameendtypet={package:Package.t;file:Odoc_file.t;digest:Digest.t;}letequal:t->t->bool=(=)lethash:t->int=Hashtbl.hashletto_stringt=Printf.sprintf"%s::%s"t.package(Odoc_file.namet.file)moduleHash_table=Hashtbl.Make(structtypenonrect=tletequal=equallethash=hashend)