Skip to content

Commit 2b8406e

Browse files
committed
mark "psuedo ops"
1 parent 4a50de3 commit 2b8406e

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

uncompyle6/scanners/scanner3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def bound_collection_from_inst(
266266
has_arg=True,
267267
has_extended_arg=False,
268268
opc=self.opc,
269-
optype=None,
269+
optype="pseudo",
270270
)
271271
)
272272
for j in range(collection_start, i):
@@ -293,7 +293,7 @@ def bound_collection_from_inst(
293293
has_arg=t.has_arg,
294294
has_extended_arg=False,
295295
opc=t.opc,
296-
optype=None,
296+
optype="pseudo",
297297
)
298298
)
299299
return new_tokens
@@ -342,7 +342,7 @@ def bound_map_from_inst(
342342
has_arg=True,
343343
has_extended_arg=False,
344344
opc=self.opc,
345-
optype=None,
345+
optype="pseudo",
346346
)
347347
)
348348
for j in range(collection_start, i, 2):

uncompyle6/scanners/scanner37.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def bound_collection_from_tokens(
9090
has_arg=True,
9191
has_extended_arg=False,
9292
opc=self.opc,
93-
optype=None,
93+
optype="pseudo",
9494
)
9595
)
9696
for j in range(collection_start, i):

uncompyle6/semantics/pysource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ def build_ast(
12671267

12681268
transform_tree = self.treeTransform.transform(ast, code)
12691269

1270-
self.maybe_show_tree(ast, phase="before")
1270+
self.maybe_show_tree(transform_tree, phase="after")
12711271

12721272
del ast # Save memory
12731273
return transform_tree

uncompyle6/semantics/transform.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -489,19 +489,9 @@ def transform(self, parse_tree: GenericASTTraversal, code) -> GenericASTTraversa
489489
self.ast[i] = self.ast[i][0]
490490

491491
if is_docstring(self.ast[i], self.version, code.co_consts):
492-
load_const = self.ast[i].first_child()
493-
docstring_ast = SyntaxTree(
494-
"docstring",
495-
[
496-
Token(
497-
"LOAD_STR",
498-
has_arg=True,
499-
offset=0,
500-
attr=load_const.attr,
501-
pattr=load_const.pattr,
502-
)
503-
],
504-
)
492+
load_const = copy(self.ast[i].first_child())
493+
store_name = copy(self.ast[i].last_child())
494+
docstring_ast = SyntaxTree("docstring", [load_const, store_name])
505495
docstring_ast.transformed_by = "transform"
506496
del self.ast[i]
507497
self.ast.insert(0, docstring_ast)

0 commit comments

Comments
 (0)