bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672)

This commit is contained in:
Pablo Galindo 2020-04-23 12:42:13 +01:00 committed by GitHub
parent ee40e4b856
commit 1df5a9e88c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 2 deletions

View file

@ -93,7 +93,9 @@ class CCallMakerVisitor(GrammarVisitor):
func, args = call.split("(", 1)
assert args[-1] == ")"
args = args[:-1]
if not args.startswith("p,"):
if "name_token" in call:
return None, f"_PyPegen_lookahead_with_name({positive}, {func}, {args})"
elif not args.startswith("p,"):
return None, f"_PyPegen_lookahead({positive}, {func}, {args})"
elif args[2:].strip().isalnum():
return None, f"_PyPegen_lookahead_with_int({positive}, {func}, {args})"