mark "psuedo ops"

This commit is contained in:
rocky 2024-02-25 06:08:06 -05:00
parent 4a50de38e4
commit 2b8406e7a8
4 changed files with 8 additions and 18 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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

View File

@ -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)