Use a single TABLE copy

This commit is contained in:
gdesmar 2024-11-12 19:42:17 +00:00
parent 37f38e45e1
commit cf34014766
No known key found for this signature in database
GPG Key ID: 99E35CDA9095D6BC
9 changed files with 1 additions and 13 deletions

View File

@ -29,7 +29,6 @@ from uncompyle6.semantics.helper import flatten_list
def customize_for_version(self, is_pypy, version):
self.TABLE_DIRECT = TABLE_DIRECT.copy()
if is_pypy:
########################
# PyPy changes
@ -264,7 +263,6 @@ def customize_for_version(self, is_pypy, version):
# < 3.0 continues
self.TABLE_R = TABLE_R.copy()
self.TABLE_R.update(
{
"STORE_SLICE+0": ("%c[:]", 0),

View File

@ -25,7 +25,7 @@ def customize_for_version25(self, version):
########################
# Import style for 2.5+
########################
TABLE_DIRECT.update(
self.TABLE_DIRECT.update(
{
"importmultiple": ("%|import %c%c\n", 2, 3),
"import_cont": (", %c", 2),

View File

@ -19,7 +19,6 @@ from uncompyle6.semantics.consts import TABLE_DIRECT
def customize_for_version26_27(self, version: tuple):
self.TABLE_DIRECT = TABLE_DIRECT.copy()
########################################
# Python 2.6+
# except <condition> as <var>

View File

@ -30,7 +30,6 @@ from uncompyle6.util import get_code_name
def customize_for_version3(self, version: tuple):
self.TABLE_DIRECT = TABLE_DIRECT.copy()
self.TABLE_DIRECT.update(
{
"comp_for": (" for %c in %c", (2, "store"), (0, "expr")),

View File

@ -26,7 +26,6 @@ from uncompyle6.semantics.helper import flatten_list, gen_function_parens_adjust
#######################
def customize_for_version35(self, version: tuple):
# fmt: off
self.TABLE_DIRECT = TABLE_DIRECT.copy()
self.TABLE_DIRECT.update(
{
# nested await expressions like:

View File

@ -96,7 +96,6 @@ def customize_for_version36(self, version: tuple):
}
)
self.TABLE_R = TABLE_R.copy()
self.TABLE_R.update(
{
"CALL_FUNCTION_EX": ("%c(*%P)", 0, (1, 2, ", ", 100)),

View File

@ -30,8 +30,6 @@ def customize_for_version37(self, version: tuple):
# Python 3.7+ changes
#######################
self.TABLE_DIRECT = TABLE_DIRECT.copy()
# fmt: off
PRECEDENCE["attribute37"] = 2
PRECEDENCE["call_ex"] = 1

View File

@ -29,8 +29,6 @@ def customize_for_version38(self, version: tuple):
# for lhs in 'for forelsestmt forelselaststmt '
# 'forelselaststmtc tryfinally38'.split():
# del TABLE_DIRECT[lhs]
self.TABLE_DIRECT = TABLE_DIRECT.copy()
self.TABLE_DIRECT.update(
{
"async_for_stmt38": (

View File

@ -656,8 +656,6 @@ class FragmentsWalker(pysource.SourceWalker, object):
code = Code(cn.attr, self.scanner, self.currentclass)
ast = self.build_ast(code._tokens, code._customize, code)
self.TABLE_DIRECT = TABLE_DIRECT.copy()
self.TABLE_R = TABLE_R.copy()
self.MAP_DIRECT = (self.TABLE_DIRECT,)
self.MAP_R = (self.TABLE_R, -1)