diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-04-09 00:17:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 00:17:31 (GMT) |
commit | 58bafe42ab161473ba36c9231c3bf2e64ac8db82 (patch) | |
tree | a482212bcff5e4e6b2f0a50021cab6c08905e0a7 /Parser/pegen.h | |
parent | 54366953633dbe5d9585dbae0c633d4e92df2d04 (diff) | |
download | cpython-58bafe42ab161473ba36c9231c3bf2e64ac8db82.zip cpython-58bafe42ab161473ba36c9231c3bf2e64ac8db82.tar.gz cpython-58bafe42ab161473ba36c9231c3bf2e64ac8db82.tar.bz2 |
Sanitize macros and debug functions in pegen.c (GH-25291)
Diffstat (limited to 'Parser/pegen.h')
-rw-r--r-- | Parser/pegen.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/pegen.h b/Parser/pegen.h index af160d6..53d8e52 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -107,8 +107,10 @@ typedef struct { int is_keyword; } KeywordOrStarred; +#if defined(Py_DEBUG) void _PyPegen_clear_memo_statistics(void); PyObject *_PyPegen_get_memo_statistics(void); +#endif int _PyPegen_insert_memo(Parser *p, int mark, int type, void *node); int _PyPegen_update_memo(Parser *p, int mark, int type, void *node); @@ -150,7 +152,7 @@ RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, #define UNUSED(expr) do { (void)(expr); } while (0) -#define EXTRA_EXPR(head, tail) head->lineno, head->col_offset, tail->end_lineno, tail->end_col_offset, p->arena +#define EXTRA_EXPR(head, tail) head->lineno, (head)->col_offset, (tail)->end_lineno, (tail)->end_col_offset, p->arena #define EXTRA _start_lineno, _start_col_offset, _end_lineno, _end_col_offset, p->arena #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) #define RAISE_INDENTATION_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_IndentationError, msg, ##__VA_ARGS__) |