Python 3.8 while and whileTrue loops

This commit is contained in:
rocky
2022-06-16 15:42:51 -04:00
parent 7fb483c566
commit 7f798541f0
5 changed files with 11 additions and 1 deletions

View File

@@ -142,6 +142,7 @@ class Python38Parser(Python37Parser):
while1stmt ::= _come_froms l_stmts COME_FROM JUMP_BACK COME_FROM_LOOP
whileTruestmt38 ::= _come_froms l_stmts JUMP_BACK
whileTruestmt38 ::= _come_froms l_stmts JUMP_BACK COME_FROM_EXCEPT_CLAUSE
whileTruestmt38 ::= _come_froms pass JUMP_BACK
for_block ::= _come_froms l_stmts_opt _come_from_loops JUMP_BACK

View File

@@ -125,7 +125,10 @@ def customize_for_version38(self, version):
(1, "testexpr"),
(2, ("l_stmts", "pass")),
),
"whileTruestmt38": ("%|while True:\n%+%c%-\n\n", (1, "l_stmts", "pass"),),
"whileTruestmt38": (
"%|while True:\n%+%c%-\n\n",
(1, ("l_stmts", "pass")),
),
"try_elsestmtl38": (
"%|try:\n%+%c%-%c%|else:\n%+%c%-",
(1, "suite_stmts_opt"),