1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192(* 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_filefilename|`Disabled->()letswitches=[("--exclude",Arg.String(funs->prerr_endline"bisect_ppx argument '--exclude' is deprecated.";prerr_endline"Use '--exclusions' instead.";Exclusions.adds)," Deprecated");("--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," Do not instrument unless environment variable 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_410beginfun_config_cookies->matchenabled()with|`Enabled->Ppx_tools_410.Ast_mapper_class.to_mapper(newInstrument.instrumenter)|`Disabled->Migrate_parsetree.Ast_410.shallow_identityend