"async for"s can has pass blocks

This commit is contained in:
rocky
2022-09-21 00:27:17 -04:00
parent be9af85e16
commit 7c3aff19af
4 changed files with 7 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019-2020 by Rocky Bernstein
# Copyright (c) 2019-2020, 2022 by Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ def customize_for_version35(self, version):
"%|async for %c in %c:\n%+%|%c%-\n\n",
(9, "store"),
(1, "expr"),
(25, "for_block"),
(25, ("for_block", "pass")),
),
"async_forelse_stmt": (
"%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n",

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021 by Rocky Bernstein
# Copyright (c) 2019-2022 by Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -61,7 +61,8 @@ def customize_for_version36(self, version):
"%|async for %c in %c:\n%+%c%-\n\n",
(9, "store"),
(1, "expr"),
(-9, "for_block"), # Count from end, since COME_FROM shifts things in the forward direction
# Count from end, since COME_FROM shifts things in the forward direction
(-9, ("for_block", "pass")),
),
"async_forelse_stmt36": (
"%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n",

View File

@@ -68,7 +68,7 @@ def customize_for_version37(self, version):
"%|async for %c in %c:\n%+%c%-\n\n",
(8, "store"),
(1, "expr"),
(17, "for_block"),
(17, ("for_block", "pass")),
),
"async_with_stmt": ("%|async with %c:\n%+%c%-", (0, "expr"), 3),
"async_with_as_stmt": (

View File

@@ -36,7 +36,7 @@ def customize_for_version38(self, version):
"%|async for %c in %c:\n%+%c%-%-\n\n",
(2, "store"),
(0, "expr"),
(3, "for_block"),
(3, ("for_block", "pass")),
),
"async_forelse_stmt38": (
"%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n",