You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
3.6-3.8 "async for" handling...
And add an if_stmt rule for 3.8. My want to extend it back to other versions.
This commit is contained in:
@@ -516,6 +516,10 @@ def customize_for_version3(self, version):
|
||||
'tryfinally_return_stmt':
|
||||
( '%|try:\n%+%c%-%|finally:\n%+%|return%-\n\n', 1 ),
|
||||
|
||||
'async_for_stmt36': (
|
||||
'%|async for %c in %c:\n%+%c%-%-\n\n',
|
||||
(9, 'store'), (1, 'expr'), (18, 'for_block') ),
|
||||
|
||||
'call_ex' : (
|
||||
'%c(%p)',
|
||||
(0, 'expr'), (1, 100)),
|
||||
@@ -917,10 +921,10 @@ def customize_for_version3(self, version):
|
||||
'attribute37': ( '%c.%[1]{pattr}', 0 ),
|
||||
'async_forelse_stmt': (
|
||||
'%|async for %c in %c:\n%+%c%-%|else:\n%+%c%-\n\n',
|
||||
7, 1, 17, (25, 'else_suite') ),
|
||||
(7, 'store'), (1, 'expr'), (17, 'for_block'), (25, 'else_suite') ),
|
||||
'async_for_stmt': (
|
||||
'%|async for %c in %c:\n%+%c%-%-\n\n',
|
||||
7, 1, 17),
|
||||
(7, 'store'), (1, 'expr'), (17, 'for_block')),
|
||||
'compare_chained1a_37': ( ' %[3]{pattr.replace("-", " ")} %p %p',
|
||||
(0, 19),
|
||||
(-4, 19)),
|
||||
@@ -931,6 +935,9 @@ def customize_for_version3(self, version):
|
||||
|
||||
'compare_chained2b_37': ( '%[1]{pattr.replace("-", " ")} %p', (0, 19)),
|
||||
|
||||
'async_for_stmt37': (
|
||||
'%|async for %c in %c:\n%+%c%-%-\n\n',
|
||||
(7, 'store'), (1, 'expr'), (16, 'for_block') ),
|
||||
})
|
||||
if version >= 3.8:
|
||||
########################
|
||||
@@ -943,6 +950,10 @@ def customize_for_version3(self, version):
|
||||
# del TABLE_DIRECT[lhs]
|
||||
|
||||
TABLE_DIRECT.update({
|
||||
'async_for_stmt38': (
|
||||
'%|async for %c in %c:\n%+%c%-%-\n\n',
|
||||
(0, 'expr'), (7, 'store'), (8, 'for_block') ),
|
||||
|
||||
'for38': (
|
||||
'%|for %c in %c:\n%+%c%-\n\n',
|
||||
(2, 'store'),
|
||||
|
Reference in New Issue
Block a user