Fix the Tools/peg_generator/scripts/benchmark.py script (GH-19848)

This commit is contained in:
Pablo Galindo 2020-05-01 22:33:54 +01:00 committed by GitHub
parent 289842ae82
commit 6bd99d5f00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -11,7 +11,7 @@ import memory_profiler
sys.path.insert(0, os.getcwd())
from peg_extension import parse
from pegen.build import build_parser_and_generator
from pegen.build import build_c_parser_and_generator
from scripts.test_parse_directory import parse_directory
argparser = argparse.ArgumentParser(
@ -93,8 +93,9 @@ def run_benchmark_stdlib(subcommand, parser):
modes = {"compile": 2, "parse": 1, "check": 0}
extension = None
if parser == "pegen":
extension = build_parser_and_generator(
extension = build_c_parser_and_generator(
"../../Grammar/python.gram",
"../../Grammar/Tokens",
"peg_extension/parse.c",
compile_extension=True,
skip_actions=False,