diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-04-23 12:42:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 12:42:13 +0100 |
commit | 1df5a9e88c8df1495a2e689d71b34bf0c7d008ea (patch) | |
tree | 4ea11b6de7ba4e8e6408532fc92d4bf5e12f7d61 /Parser/pegen/pegen.c | |
parent | ee40e4b8563e6e1bc2bfb267da5ffc9a2293318d (diff) | |
download | cpython-git-1df5a9e88c8df1495a2e689d71b34bf0c7d008ea.tar.gz |
bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672)
Diffstat (limited to 'Parser/pegen/pegen.c')
-rw-r--r-- | Parser/pegen/pegen.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 44198ab67b..0b70c950d8 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -640,6 +640,16 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres) return 0; } + +int +_PyPegen_lookahead_with_name(int positive, expr_ty (func)(Parser *), Parser *p) +{ + int mark = p->mark; + void *res = func(p); + p->mark = mark; + return (res != NULL) == positive; +} + int _PyPegen_lookahead_with_string(int positive, void *(func)(Parser *, const char *), Parser *p, const char *arg) @@ -663,7 +673,7 @@ int _PyPegen_lookahead(int positive, void *(func)(Parser *), Parser *p) { int mark = p->mark; - void *res = func(p); + void *res = (void*)func(p); p->mark = mark; return (res != NULL) == positive; } |