diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-09-03 14:29:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 14:29:32 (GMT) |
commit | 315a61f7a9418d904e0eea14b1f054fac3a90e9f (patch) | |
tree | 621d8d728f29ec583fdda94e262182129fe81a15 /Parser/parser.c | |
parent | 851606007665dc30089e5e1953208c5428e455b1 (diff) | |
download | cpython-315a61f7a9418d904e0eea14b1f054fac3a90e9f.zip cpython-315a61f7a9418d904e0eea14b1f054fac3a90e9f.tar.gz cpython-315a61f7a9418d904e0eea14b1f054fac3a90e9f.tar.bz2 |
bpo-41697: Correctly handle KeywordOrStarred when parsing arguments in the parser (GH-22077)
Diffstat (limited to 'Parser/parser.c')
-rw-r--r-- | Parser/parser.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Parser/parser.c b/Parser/parser.c index 3e724a2..8a7cb62 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -12237,7 +12237,16 @@ args_rule(Parser *p) ) { D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]")); - _res = _PyPegen_collect_call_seqs ( p , a , b ); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyPegen_collect_call_seqs ( p , a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); |