mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672)
This commit is contained in:
parent
ee40e4b856
commit
1df5a9e88c
4 changed files with 17 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ int _PyPegen_insert_memo(Parser *p, int mark, int type, void *node);
|
|||
int _PyPegen_update_memo(Parser *p, int mark, int type, void *node);
|
||||
int _PyPegen_is_memoized(Parser *p, int type, void *pres);
|
||||
|
||||
int _PyPegen_lookahead_with_name(int, expr_ty (func)(Parser *), Parser *);
|
||||
int _PyPegen_lookahead_with_string(int, void *(func)(Parser *, const char *), Parser *, const char *);
|
||||
int _PyPegen_lookahead_with_int(int, Token *(func)(Parser *, int), Parser *, int);
|
||||
int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue