You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
Tidy a little ...
parse32.py: Move common grammar rules from parse32.py to parse3.py parse32 should just have 3.2ish specific stuff. parse3.py: favor addRule over add_unique_rule pysource.py: make more clear what's up with comprehensions. more later.
This commit is contained in:
@@ -1082,9 +1082,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
assert n == 'list_iter'
|
||||
|
||||
# find innermost node
|
||||
# Find the list comprehension body. It is the inner-most
|
||||
# node.
|
||||
while n == 'list_iter':
|
||||
n = n[0] # recurse one step
|
||||
n = n[0] # iterate one nesting deeper
|
||||
if n == 'list_for': n = n[3]
|
||||
elif n == 'list_if': n = n[2]
|
||||
elif n == 'list_if_not': n= n[2]
|
||||
@@ -1140,9 +1141,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
assert n == 'list_iter'
|
||||
assert store == 'store'
|
||||
|
||||
# find innermost node
|
||||
# Find the list comprehension body. It is the inner-most
|
||||
# node.
|
||||
while n == 'list_iter':
|
||||
n = n[0] # recurse one step
|
||||
n = n[0] # iterate one nesting deeper
|
||||
if n == 'list_for': n = n[3]
|
||||
elif n == 'list_if': n = n[2]
|
||||
elif n == 'list_if_not': n= n[2]
|
||||
|
Reference in New Issue
Block a user