Pablo Galindo Salgado <pablog...@gmail.com> added the comment:
Well, in any case, I will submit a patch today to the parser generator to substitute the NULL for single-element arrays which seems to work. Michael, could you confirm that this patch works for you: diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index 9d3ac575df..e5511bf815 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -1,6 +1,6 @@ -// @generated by pegen.py from ./Grammar/python.gram -#include "pegen.h" +#include "pegen.h" +// @generated by pegen.py from ./Grammar/python.gram #if defined(Py_DEBUG) && defined(Py_BUILD_CORE) extern int Py_DebugFlag; #define D(x) if (Py_DebugFlag) x; @@ -9,8 +9,8 @@ extern int Py_DebugFlag; #endif static const int n_keyword_lists = 15; static KeywordToken *reserved_keywords[] = { - NULL, - NULL, + (KeywordToken[]) {{NULL, -1}}, + (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) { {"if", 510}, {"in", 518}, @@ -65,11 +65,11 @@ static KeywordToken *reserved_keywords[] = { {"nonlocal", 509}, {NULL, -1}, }, - NULL, - NULL, - NULL, - NULL, - NULL, + (KeywordToken[]) {{NULL, -1}}, + (KeywordToken[]) {{NULL, -1}}, + (KeywordToken[]) {{NULL, -1}}, + (KeywordToken[]) {{NULL, -1}}, + (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) { {"__peg_parser__", 531}, {NULL, -1}, @@ -24735,7 +24735,6 @@ _PyPegen_parse(Parser *p) // Initialize keywords p->keywords = reserved_keywords; p->n_keyword_lists = n_keyword_lists; - // Run parser void *result = NULL; if (p->start_rule == Py_file_input) { ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41215> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com