bpo-40334: Reproduce error message for type comments on bare '*' by lysnikolaou · Pull Request #20151 · python/cpython
void *_PyPegen_arguments_parsing_error(Parser *p, expr_ty e) { int kwarg_unpacking = 0; for (Py_ssize_t i = 0, l = asdl_seq_LEN(e->v.Call.keywords); i < l; i++) { keyword_ty keyword = asdl_seq_GET(e->v.Call.keywords, i); if (!keyword->arg) { kwarg_unpacking = 1; } }
const char *msg = NULL; if (kwarg_unpacking) { msg = "positional argument follows keyword argument unpacking"; } else { msg = "positional argument follows keyword argument"; }
return RAISE_SYNTAX_ERROR(msg); }
#if 0 static const char * token_name(int type)
void *_PyPegen_arguments_parsing_error(Parser *p, expr_ty e) { int kwarg_unpacking = 0; for (Py_ssize_t i = 0, l = asdl_seq_LEN(e->v.Call.keywords); i < l; i++) { keyword_ty keyword = asdl_seq_GET(e->v.Call.keywords, i); if (!keyword->arg) { kwarg_unpacking = 1; } }
const char *msg = NULL; if (kwarg_unpacking) { msg = "positional argument follows keyword argument unpacking"; } else { msg = "positional argument follows keyword argument"; }
return RAISE_SYNTAX_ERROR(msg); }