123456789101112131415161718192021222324252627282930313233343536373839openBaseopenPpxlibopenAst_builder.Defaultletdisabled_warnings="-26-27-32-33-34-35-36-37-38-39-60-66-67"letpayload~loc=PStr[pstr_eval~loc(estring~locdisabled_warnings)[]]letexpand_disabled_unused_warnings_attributeattr=assert(String.equalattr.attr_name.txt"disable_unused_warnings");letloc={attr.attr_name.locwithloc_ghost=true}inletname=Loc.make~loc"warning"inletpayload=payload~locinattribute~loc~name~payload;;classattribute_mapper=objectinheritAst_traverse.mapassupermethod!attributeattr=matchattrwith|{attr_name={txt="disable_unused_warnings";_};attr_payload=PStr[];attr_loc=_}->Attribute.mark_as_handled_manuallyattr;expand_disabled_unused_warnings_attributeattr|_->super#attributeattrendletexpand_disabled_unused_warnings=(newattribute_mapper)#structurelet()=(* The ~rules argument isn't expressive enough to use here (it can't handle attributes
in all positions *)Driver.register_transformation"disable_unused_warnings"~impl:expand_disabled_unused_warnings;;