You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
mark "psuedo ops"
This commit is contained in:
@@ -266,7 +266,7 @@ class Scanner3(Scanner):
|
|||||||
has_arg=True,
|
has_arg=True,
|
||||||
has_extended_arg=False,
|
has_extended_arg=False,
|
||||||
opc=self.opc,
|
opc=self.opc,
|
||||||
optype=None,
|
optype="pseudo",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
for j in range(collection_start, i):
|
for j in range(collection_start, i):
|
||||||
@@ -293,7 +293,7 @@ class Scanner3(Scanner):
|
|||||||
has_arg=t.has_arg,
|
has_arg=t.has_arg,
|
||||||
has_extended_arg=False,
|
has_extended_arg=False,
|
||||||
opc=t.opc,
|
opc=t.opc,
|
||||||
optype=None,
|
optype="pseudo",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return new_tokens
|
return new_tokens
|
||||||
@@ -342,7 +342,7 @@ class Scanner3(Scanner):
|
|||||||
has_arg=True,
|
has_arg=True,
|
||||||
has_extended_arg=False,
|
has_extended_arg=False,
|
||||||
opc=self.opc,
|
opc=self.opc,
|
||||||
optype=None,
|
optype="pseudo",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
for j in range(collection_start, i, 2):
|
for j in range(collection_start, i, 2):
|
||||||
|
@@ -90,7 +90,7 @@ class Scanner37(Scanner37Base):
|
|||||||
has_arg=True,
|
has_arg=True,
|
||||||
has_extended_arg=False,
|
has_extended_arg=False,
|
||||||
opc=self.opc,
|
opc=self.opc,
|
||||||
optype=None,
|
optype="pseudo",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
for j in range(collection_start, i):
|
for j in range(collection_start, i):
|
||||||
|
@@ -1267,7 +1267,7 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
|||||||
|
|
||||||
transform_tree = self.treeTransform.transform(ast, code)
|
transform_tree = self.treeTransform.transform(ast, code)
|
||||||
|
|
||||||
self.maybe_show_tree(ast, phase="before")
|
self.maybe_show_tree(transform_tree, phase="after")
|
||||||
|
|
||||||
del ast # Save memory
|
del ast # Save memory
|
||||||
return transform_tree
|
return transform_tree
|
||||||
|
@@ -489,19 +489,9 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
self.ast[i] = self.ast[i][0]
|
self.ast[i] = self.ast[i][0]
|
||||||
|
|
||||||
if is_docstring(self.ast[i], self.version, code.co_consts):
|
if is_docstring(self.ast[i], self.version, code.co_consts):
|
||||||
load_const = self.ast[i].first_child()
|
load_const = copy(self.ast[i].first_child())
|
||||||
docstring_ast = SyntaxTree(
|
store_name = copy(self.ast[i].last_child())
|
||||||
"docstring",
|
docstring_ast = SyntaxTree("docstring", [load_const, store_name])
|
||||||
[
|
|
||||||
Token(
|
|
||||||
"LOAD_STR",
|
|
||||||
has_arg=True,
|
|
||||||
offset=0,
|
|
||||||
attr=load_const.attr,
|
|
||||||
pattr=load_const.pattr,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
docstring_ast.transformed_by = "transform"
|
docstring_ast.transformed_by = "transform"
|
||||||
del self.ast[i]
|
del self.ast[i]
|
||||||
self.ast.insert(0, docstring_ast)
|
self.ast.insert(0, docstring_ast)
|
||||||
|
Reference in New Issue
Block a user