123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960(* This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at http://mozilla.org/MPL/2.0/. *)letconditional=reffalseletenabled()=match!conditionalwith|false->`Enabled|true->matchSys.getenv"BISECT_ENABLE"with|exceptionNot_found->`Disabled|swhen(String.uppercase[@ocaml.warning"-3"])s="YES"->`Enabled|_->`Disabledletconditional_exclude_filefilename=matchenabled()with|`Enabled->Exclusions.add_filefilename|`Disabled->()letswitches=[("-exclude",Arg.StringExclusions.add,"<pattern> Exclude functions matching pattern");("-exclude-file",Arg.Stringconditional_exclude_file,"<filename> Exclude functions listed in given file");("-mode",(Arg.Symbol(["safe";"fast";"faster"],ignore))," Ignored");("-conditional",Arg.Setconditional," Do not instrument unless environment variable BISECT_ENABLE is YES");("-no-comment-parsing",Arg.SetComments.no_comment_parsing," Do not parse source files for BISECT-* comments");]let()=Migrate_parsetree.Driver.register~name:"bisect_ppx"~args:switches~position:100Migrate_parsetree.Versions.ocaml_409beginfun_config_cookies->matchenabled()with|`Enabled->Ppx_tools_409.Ast_mapper_class.to_mapper(newInstrument.instrumenter)|`Disabled->Migrate_parsetree.Ast_409.shallow_identityend