[parser] Flag single unparenthesized generator expr with trailing comma in arguments. (#17893)

Fixes #17867

## Summary

The CPython parser does not allow generator expressions which are the
sole arguments in an argument list to have a trailing comma.
With this change, we start flagging such instances.

## Test Plan

Added new inline tests.
This commit is contained in:
Abhijeet Prasad Bodas 2025-05-07 23:41:35 +05:30 committed by GitHub
parent 895b6161a6
commit f5096f2050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 426 additions and 124 deletions

View file

@ -1,2 +1,3 @@
sum(x for x in range(10), 5)
total(1, 2, x for x in range(5), 6)
sum(x for x in range(10),)

View file

@ -1 +1,3 @@
zip((x for x in range(10)), (y for y in range(10)))
sum(x for x in range(10))
sum((x for x in range(10)),)