mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 13:09:49 +00:00
mark "psuedo ops"
This commit is contained in:
parent
4a50de38e4
commit
2b8406e7a8
@ -266,7 +266,7 @@ class Scanner3(Scanner):
|
||||
has_arg=True,
|
||||
has_extended_arg=False,
|
||||
opc=self.opc,
|
||||
optype=None,
|
||||
optype="pseudo",
|
||||
)
|
||||
)
|
||||
for j in range(collection_start, i):
|
||||
@ -293,7 +293,7 @@ class Scanner3(Scanner):
|
||||
has_arg=t.has_arg,
|
||||
has_extended_arg=False,
|
||||
opc=t.opc,
|
||||
optype=None,
|
||||
optype="pseudo",
|
||||
)
|
||||
)
|
||||
return new_tokens
|
||||
@ -342,7 +342,7 @@ class Scanner3(Scanner):
|
||||
has_arg=True,
|
||||
has_extended_arg=False,
|
||||
opc=self.opc,
|
||||
optype=None,
|
||||
optype="pseudo",
|
||||
)
|
||||
)
|
||||
for j in range(collection_start, i, 2):
|
||||
|
@ -90,7 +90,7 @@ class Scanner37(Scanner37Base):
|
||||
has_arg=True,
|
||||
has_extended_arg=False,
|
||||
opc=self.opc,
|
||||
optype=None,
|
||||
optype="pseudo",
|
||||
)
|
||||
)
|
||||
for j in range(collection_start, i):
|
||||
|
@ -1267,7 +1267,7 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
||||
|
||||
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
|
||||
return transform_tree
|
||||
|
@ -489,19 +489,9 @@ class TreeTransform(GenericASTTraversal, object):
|
||||
self.ast[i] = self.ast[i][0]
|
||||
|
||||
if is_docstring(self.ast[i], self.version, code.co_consts):
|
||||
load_const = self.ast[i].first_child()
|
||||
docstring_ast = SyntaxTree(
|
||||
"docstring",
|
||||
[
|
||||
Token(
|
||||
"LOAD_STR",
|
||||
has_arg=True,
|
||||
offset=0,
|
||||
attr=load_const.attr,
|
||||
pattr=load_const.pattr,
|
||||
)
|
||||
],
|
||||
)
|
||||
load_const = copy(self.ast[i].first_child())
|
||||
store_name = copy(self.ast[i].last_child())
|
||||
docstring_ast = SyntaxTree("docstring", [load_const, store_name])
|
||||
docstring_ast.transformed_by = "transform"
|
||||
del self.ast[i]
|
||||
self.ast.insert(0, docstring_ast)
|
||||
|
Loading…
Reference in New Issue
Block a user