12345678910111213141516171819202122232425262728293031323334353637openImportopenAst_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)[]end