123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126openLangtypeitem=|CompilationUnitofCompilation_unit.t|TypeDeclofTypeDecl.t|ModuleofModule.t|ValueofValue.t|ExceptionofException.t|ClassTypeofClassType.t|MethodofMethod.t|ClassofClass.t|ExtensionofExtension.t|ModuleTypeofModuleType.t|DocofComment.docs_or_stopletrecunit~faccu=letacc=facc(CompilationUnitu)inmatchu.contentwithModulem->signature~faccm|Pack_->accandpage~faccp=letopenPageindocs~facc(`Docsp.content)andsignature~facc(s:Signature.t)=List.fold_left(signature_item~f)accs.itemsandsignature_item~faccs_item=matchs_itemwith|Module(_,m)->module_~faccm|ModuleTypemt->module_type~faccmt|ModuleSubstitution_->acc|ModuleTypeSubstitution_->acc|Open_->acc|Type(_,t_decl)->type_decl~facct_decl|TypeSubstitution_->acc|TypExtte->type_extension~faccte|Exceptionexc->exception_~faccexc|Valuev->value~faccv|Class(_,cl)->class_~facccl|ClassType(_,clt)->class_type~faccclt|Includei->include_~facci|Commentd->docs~faccdanddocs~faccd=facc(Docd)andinclude_~faccinc=signature~faccinc.expansion.contentandclass_type~faccct=(* This check is important because [is_internal] does not work on children of
internal items. This means that if [Fold] did not make this check here,
it would be difficult to filter for internal items afterwards. This also
applies to the same check in functions bellow. *)ifPaths.Identifier.is_internalct.idthenaccelseletacc=facc(ClassTypect)inmatchct.expansionwithNone->acc|Somecs->class_signature~facccsandclass_signature~faccct_expr=List.fold_left(class_signature_item~f)accct_expr.itemsandclass_signature_item~faccitem=matchitemwith|Methodm->facc(Methodm)|InstanceVariable_->acc|Constraint_->acc|Inherit_->acc|Commentd->docs~faccdandclass_~facccl=ifPaths.Identifier.is_internalcl.idthenaccelseletacc=facc(Classcl)inmatchcl.expansionwith|None->acc|Somecl_signature->class_signature~facccl_signatureandexception_~faccexc=ifPaths.Identifier.is_internalexc.idthenaccelsefacc(Exceptionexc)andtype_extension~faccte=facc(Extensionte)andvalue~faccv=ifPaths.Identifier.is_internalv.idthenaccelsefacc(Valuev)andmodule_~faccm=ifPaths.Identifier.is_internalm.idthenaccelseletacc=facc(Modulem)inmatchm.type_with|Alias(_,None)->acc|Alias(_,Somes_e)->simple_expansion~faccs_e|ModuleTypemte->module_type_expr~faccmteandtype_decl~facctd=ifPaths.Identifier.is_internaltd.idthenaccelsefacc(TypeDecltd)andmodule_type~faccmt=ifPaths.Identifier.is_internalmt.idthenaccelseletacc=facc(ModuleTypemt)inmatchmt.exprwith|None->acc|Somemt_expr->module_type_expr~faccmt_exprandsimple_expansion~faccs_e=matchs_ewith|Signaturesg->signature~faccsg|Functor(p,s_e)->letacc=functor_parameter~faccpinsimple_expansion~faccs_eandmodule_type_expr~faccmte=matchmtewith|Signatures->signature~faccs|Functor(fp,mt_expr)->letacc=functor_parameter~faccfpinmodule_type_expr~faccmt_expr|With{w_expansion=Somesg;_}->simple_expansion~faccsg|TypeOf{t_expansion=Somesg;_}->simple_expansion~faccsg|Path{p_expansion=Somesg;_}->simple_expansion~faccsg|Path{p_expansion=None;_}->acc|With{w_expansion=None;_}->acc|TypeOf{t_expansion=None;_}->accandfunctor_parameter~faccfp=matchfpwithUnit->acc|Namedn->module_type_expr~faccn.expr