diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-05-06 21:54:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 21:54:34 (GMT) |
commit | 99db2a1db7a9b468a0ce8377d579f78fa03a2a34 (patch) | |
tree | 5752707eb45888e127ba1ae74721f2237a878f97 /Grammar | |
parent | 441416c9a06f11f28e17d56c915ea6116c0c9ea7 (diff) | |
download | cpython-99db2a1db7a9b468a0ce8377d579f78fa03a2a34.zip cpython-99db2a1db7a9b468a0ce8377d579f78fa03a2a34.tar.gz cpython-99db2a1db7a9b468a0ce8377d579f78fa03a2a34.tar.bz2 |
bpo-40334: Allow trailing comma in parenthesised context managers (GH-19964)
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/python.gram | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 3f16768..3d8a39b 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -170,11 +170,11 @@ for_stmt[stmt_ty]: CHECK_VERSION(5, "Async for loops are", _Py_AsyncFor(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA)) } with_stmt[stmt_ty]: - | 'with' '(' a=','.with_item+ ')' ':' b=block { + | 'with' '(' a=','.with_item+ ','? ')' ':' b=block { _Py_With(a, b, NULL, EXTRA) } | 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { _Py_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } - | ASYNC 'with' '(' a=','.with_item+ ')' ':' b=block { + | ASYNC 'with' '(' a=','.with_item+ ','? ')' ':' b=block { CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NULL, EXTRA)) } | ASYNC 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) } |