mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'.
This commit is contained in:
parent
cedef652fa
commit
14acf5f41d
6 changed files with 44 additions and 38 deletions
|
@ -2859,8 +2859,8 @@ validate_arglist(node *tree)
|
|||
|
||||
/* argument: ( test [comp_for] |
|
||||
* test '=' test |
|
||||
* '**' expr |
|
||||
* star_expr )
|
||||
* '**' test |
|
||||
* '*' test )
|
||||
*/
|
||||
static int
|
||||
validate_argument(node *tree)
|
||||
|
@ -2873,8 +2873,11 @@ validate_argument(node *tree)
|
|||
if (TYPE(CHILD(tree, 0)) == DOUBLESTAR) {
|
||||
res = validate_test(CHILD(tree, 1));
|
||||
}
|
||||
else if (TYPE(CHILD(tree, 0)) == STAR) {
|
||||
res = validate_test(CHILD(tree, 1));
|
||||
}
|
||||
else if (nch == 1) {
|
||||
res = validate_test_or_star_expr(CHILD(tree, 0));
|
||||
res = validate_test(CHILD(tree, 0));
|
||||
}
|
||||
else if (nch == 2) {
|
||||
res = (validate_test(CHILD(tree, 0))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue