123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152(*
* Copyright (c) 2015 Leo White <lpw25@cl.cam.ac.uk>
* Copyright (c) 2016, 2017 Thomas Refis <trefis@janestreet.com>
*
*
* 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.
*)classlookup=objectvalenv=Name_env.emptyinheritOdoc_model.Maps.typesassupermethodrootx=xmethodpath_typex=xmethodpath_module_typex=xmethodpath_modulex=xmethodpath_class_typex=xmethodidentifier_valuex=xmethodidentifier_typex=xmethodidentifier_module_typex=xmethodidentifier_modulex=xmethodidentifier_methodx=xmethodidentifier_labelx=xmethodidentifier_pagex=xmethodidentifier_instance_variablex=xmethodidentifier_fieldx=xmethodidentifier_extensionx=xmethodidentifier_exceptionx=xmethodidentifier_constructorx=xmethodidentifier_class_typex=xmethodidentifier_classx=xmethodidentifier_signaturex=xmethodidentifierx=xmethodfragment_typex=xmethodfragment_modulex=xmethodreference_modulex=Name_env.lookup_moduleenvxmethodreference_module_typex=Name_env.lookup_module_typeenvxmethodreference_typex=Name_env.lookup_typeenvxmethodreference_constructorx=Name_env.lookup_constructorenvxmethodreference_fieldx=Name_env.lookup_fieldenvxmethodreference_extensionx=Name_env.lookup_extensionenvxmethodreference_exceptionx=Name_env.lookup_exceptionenvxmethodreference_valuex=Name_env.lookup_valueenvxmethodreference_classx=Name_env.lookup_classenvxmethodreference_class_typex=Name_env.lookup_class_typeenvxmethodreference_methodx=Name_env.lookup_methodenvxmethodreference_instance_variablex=Name_env.lookup_instance_variableenvxmethodreference_labelx=Name_env.lookup_labelenvxmethodreference_anyx=Name_env.lookup_elementenvxmethodsuper_modulemd=super#module_mdmethod!module_md=(* let open Module in *)letenv=Name_env.add_module_decl_itemsmd.type_envinletthis={<env=env>}inthis#super_modulemdmethodsuper_module_typemty=super#module_typemtymethod!module_typemty=(* let open ModuleType in *)letenv=matchmty.exprwith|None->env|Someexpr->Name_env.add_module_type_expr_itemsexprenvinletthis={<env=env>}inthis#super_module_typemtymethodsuper_unitunt=super#unituntmethod!unitunt=letenv=Name_env.add_unituntenvinletenv=matchunt.contentwith|Moduleitems->Name_env.add_signature_itemsitemsenv|Pack_->envinletthis={<env=env>}inthis#super_unituntmethodsuper_pagepage=super#pagepagemethod!pagepage=letenv=Name_env.add_pagepageenvinletthis={<env=env>}inthis#super_pagepagemethodsuper_classcl=super#class_clmethod!class_cl=letenv=Name_env.add_class_decl_itemscl.type_envinletthis={<env=env>}inthis#super_classclmethodsuper_class_typecltyp=super#class_typecltypmethod!class_typecltyp=letenv=Name_env.add_class_type_expr_itemscltyp.exprenvinletthis={<env=env>}inthis#super_class_typecltypmethod!documentation_referencer=let(path,elements)=super#documentation_referencerinmatchpath,elementswith|`Resolved(`Identifier(`Label_)|`Label_asrr),[]->beginmatchName_env.lookup_section_titleenvrrwith|None->(path,elements)|Someelements'->(path,elements')end|_->(path,elements)endletlookupx=letobj=newlookupinobj#unitxletlookup_pagex=letobj=newlookupinobj#pagex