mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576)
(cherry picked from commit e5f13ce5b4
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
fae2694bea
commit
9e209d48ca
5 changed files with 31 additions and 8 deletions
|
@ -17902,15 +17902,15 @@ invalid_arguments_rule(Parser *p)
|
|||
}
|
||||
D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args for_if_clauses"));
|
||||
expr_ty a;
|
||||
asdl_comprehension_seq* for_if_clauses_var;
|
||||
asdl_comprehension_seq* b;
|
||||
if (
|
||||
(a = args_rule(p)) // args
|
||||
&&
|
||||
(for_if_clauses_var = for_if_clauses_rule(p)) // for_if_clauses
|
||||
(b = for_if_clauses_rule(p)) // for_if_clauses
|
||||
)
|
||||
{
|
||||
D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args for_if_clauses"));
|
||||
_res = _PyPegen_nonparen_genexp_in_call ( p , a );
|
||||
_res = _PyPegen_nonparen_genexp_in_call ( p , a , b );
|
||||
if (_res == NULL && PyErr_Occurred()) {
|
||||
p->error_indicator = 1;
|
||||
D(p->level--);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue