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

@ -15,7 +15,7 @@
from pegen.python_generator import PythonParserGenerator
from pegen.tokenizer import Tokenizer
MOD_DIR = pathlib.Path(__file__).parent
MOD_DIR = pathlib.Path(__file__).resolve().parent
def get_extra_flags(compiler_flags: str, compiler_py_flags_nodist: str) -> List[str]:

View file

@ -11,7 +11,7 @@
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,