mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Merge pull request #17873 from github/tausbn/python-fix-generator-expression-locations
Python: Even more parser fixes
This commit is contained in:
8
python/extractor/tests/parser/async-await.py
Normal file
8
python/extractor/tests/parser/async-await.py
Normal file
@@ -0,0 +1,8 @@
|
||||
async def foo():
|
||||
await bar() + await baz()
|
||||
|
||||
async with foo() as bar, baz() as quux:
|
||||
pass
|
||||
|
||||
async for spam in eggs:
|
||||
pass
|
||||
@@ -35,3 +35,5 @@ t, u,
|
||||
x, y,
|
||||
#comment
|
||||
)
|
||||
|
||||
((z,))
|
||||
|
||||
@@ -65,3 +65,10 @@ t = tuple(x for y in z)
|
||||
d for e in f if g # comment
|
||||
# comment
|
||||
] # comment
|
||||
|
||||
# Generator expression with comments
|
||||
(# comment
|
||||
alpha # comment
|
||||
for beta in gamma # comment
|
||||
# comment
|
||||
)
|
||||
|
||||
@@ -77,3 +77,12 @@ if 34:
|
||||
b'\xc5\xe5'
|
||||
if 35:
|
||||
f"{x=}"
|
||||
if 36:
|
||||
r"a\"a"
|
||||
if 37:
|
||||
r'a\'a'
|
||||
if 38:
|
||||
r'a\\'
|
||||
if 39:
|
||||
r'a\
|
||||
'
|
||||
|
||||
Reference in New Issue
Block a user