123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(* This file is part of Bisect_ppx, released under the MIT license. See
LICENSE.md for details, or visit
https://github.com/aantron/bisect_ppx/blob/master/LICENSE.md. *)moduleCommon=Bisect_commonletconditional=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_from_filefilename|`Disabled->()letswitches=[("--exclude",Arg.String(funs->prerr_endline"bisect_ppx argument '--exclude' is deprecated.";prerr_endline"Use '--exclusions' instead.";Exclusions.adds)," Deprecated");("--exclude-files",Arg.StringExclusions.add_file,"<regexp> Exclude files matching <regexp>");("--exclusions",Arg.Stringconditional_exclude_file,"<filename> Exclude functions listed in given file");("--exclude-file",Arg.String(funs->prerr_endline"bisect_ppx argument '--exclude-file' is deprecated.";prerr_endline"It has been renamed to '--exclusions'.";conditional_exclude_files)," Deprecated");("--conditional",Arg.Setconditional," Instrument only when BISECT_ENABLE is YES");("--no-comment-parsing",Arg.Unit(fun()->prerr_endline"bisect_ppx argument '--no-comment-parsing' is deprecated.")," Deprecated");("-mode",(Arg.Symbol(["safe";"fast";"faster"],fun_->prerr_endline"bisect_ppx argument '-mode' is deprecated."))," Deprecated");("--bisect-file",Arg.String(funs->Common.bisect_file:=Somes)," Default value for BISECT_FILE environment variable");("--bisect-silent",Arg.String(funs->Common.bisect_silent:=Somes)," Default value for BISECT_SILENT environment variable");]letdeprecated=Common.deprecated"bisect_ppx"letswitches=switches|>deprecated"-exclude"|>deprecated"-exclude-file"|>deprecated"-conditional"|>deprecated"-no-comment-parsing"|>Arg.alignlet()=Migrate_parsetree.Driver.register~name:"bisect_ppx"~args:switches~position:100Migrate_parsetree.Versions.ocaml_411beginfun_config_cookies->matchenabled()with|`Enabled->Ppx_tools_411.Ast_mapper_class.to_mapper(newInstrument.instrumenter)|`Disabled->Migrate_parsetree.Ast_411.shallow_identityend