def run_benchmark_stdlib(subcommand, parser): modes = {"compile": 2, "parse": 1, "check": 0} extension = None if parser == "pegen": extension = build_parser_and_generator( "../../Grammar/python.gram", "peg_extension/parse.c", compile_extension=True, skip_actions=False, ) for _ in range(3): parse_directory( "../../Lib", "../../Grammar/python.gram", verbose=False, excluded_files=[ "*/bad*", "*/lib2to3/tests/data/*", ], skip_actions=False, tree_arg=0, short=True, extension=extension, mode=modes[subcommand], parser=parser, )
def run_benchmark_stdlib(subcommand): modes = {"compile": 2, "parse": 1} for _ in range(3): parse_directory( "../../Lib", verbose=False, excluded_files=[ "*/bad*", "*/lib2to3/tests/data/*", ], short=True, mode=modes[subcommand], )
def run_benchmark_stdlib(subcommand, parser): modes = {"compile": 2, "parse": 1, "notree": 0} for _ in range(3): parse_directory( "../../Lib", verbose=False, excluded_files=[ "*/bad*", "*/lib2to3/tests/data/*", ], tree_arg=0, short=True, mode=modes[subcommand], oldparser=(parser == "old"), )
def run_tests(dirname: str, tree: int) -> int: return test_parse_directory.parse_directory( dirname, verbose=False, excluded_files=[], tree_arg=tree, short=True, mode=1 if tree else 0, parser="pegen", )
def run_tests(dirname: str, tree: int, extension: Any) -> int: return test_parse_directory.parse_directory( dirname, "data/simpy.gram", verbose=False, excluded_files=[ "*/failset/*", "*/failset/**", "*/failset/**/*", "*/test2to3/*", "*/test2to3/**/*", "*/bad*", "*/lib2to3/tests/data/*", ], skip_actions=False, tree_arg=tree, short=True, extension=extension, )
def run_tests(dirname: str, tree: int) -> int: return test_parse_directory.parse_directory( dirname, "data/python.gram", verbose=False, excluded_files=[ "*/failset/*", "*/failset/**", "*/failset/**/*", "*/test2to3/*", "*/test2to3/**/*", "*/bad*", "*/lib2to3/tests/data/*", ], skip_actions=False, tree_arg=tree, short=True, parser=None, )
def run_tests(dirname: str, tree: int) -> int: return test_parse_directory.parse_directory( dirname, HERE / ".." / ".." / ".." / "Grammar" / "python.gram", HERE / ".." / ".." / ".." / "Grammar" / "Tokens", verbose=False, excluded_files=[ "*/failset/*", "*/failset/**", "*/failset/**/*", "*/test2to3/*", "*/test2to3/**/*", "*/bad*", "*/lib2to3/tests/data/*", ], skip_actions=False, tree_arg=tree, short=True, mode=1, parser="pegen", )
def run_benchmark_stdlib(subcommand): modes = {"compile": 2, "parse": 1} ======= time_parse(source, parser) elif subcommand == "notree": time_notree(source, parser) def run_benchmark_stdlib(subcommand, parser): modes = {"compile": 2, "parse": 1, "notree": 0} >>>>>>> 3.9 for _ in range(3): parse_directory( "../../Lib", verbose=False, excluded_files=["*/bad*", "*/lib2to3/tests/data/*",], <<<<<<< HEAD short=True, mode=modes[subcommand], ======= tree_arg=0, short=True, mode=modes[subcommand], oldparser=(parser == "old"), >>>>>>> 3.9 ) def main(): args = argparser.parse_args()