12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182openImportopenAst_builder.Defaultletunderscore_bindingexp=letloc=exp.pexp_locinvalue_binding~loc~pat:(ppat_any~loc)~expr:expletvars_of=objectinherit[Longident.tLocated.tlist]Ast_traverse.foldassupermethod!patternpattacc=matchpatt.ppat_descwith|Ppat_varv->Located.map(funvar->Longident.Lidentvar)v::acc|_->super#patternpattaccend(* For every [let x = ...] structure item, add a [let _ = x] *)letadd_dummy_user_for_values=objectinheritAst_traverse.mapassupermethod!structurest=letrecloopstacc=matchstwith|[]->List.revacc|({pstr_desc=Pstr_value(_,vbs);pstr_loc=loc}asitem)::rest->letvars=List.fold_leftvbs~init:[]~f:(funaccvb->vars_of#patternvb.pvb_patacc)inletign=pstr_value_list~locNonrecursive(List.rev_mapvars~f:(funv->underscore_binding(pexp_ident~loc:v.locv)))inlooprest(ign@(item::acc))|item::rest->looprest(item::acc)inloop(super#structurest)[]endletbinds_module_names=objectinherit[bool]Ast_traverse.foldassupermethod!module_bindingmbacc=matchmb.pmb_name.txtwith|Some(_:string)->true|None->super#module_bindingmbaccmethod!module_declarationmdacc=matchmd.pmd_name.txtwith|Some(_:string)->true|None->super#module_declarationmdaccmethod!module_substitutionms_=matchms.pms_name.txtwith(_:string)->truemethod!functor_parameterfpacc=matchfpwith|Unit->acc|Named(name,_)->(matchname.txtwith|Some(_:string)->true|None->super#functor_parameterfpacc)method!patternpatacc=matchpat.ppat_descwith|Ppat_unpackname->(matchname.txtwithSome(_:string)->true|None->acc)|_->super#patternpataccmethod!expressionexpracc=matchexpr.pexp_descwith|Pexp_letmodule(name,_,_)->(matchname.txtwith|Some(_:string)->true|None->super#expressionexpracc)|_->super#expressionexpraccend