LOAD_CONST -> LOAD_CODE where appropriate

This commit is contained in:
rocky
2019-06-19 14:43:07 -04:00
parent e2d7f01298
commit 24afe072b7
7 changed files with 72 additions and 42 deletions

View File

@@ -1015,19 +1015,19 @@ class Python3Parser(PythonParser):
# Note order of kwargs and pos args changed between 3.3-3.4
if self.version <= 3.2:
rule = "mkfunc ::= %s%sload_closure LOAD_CONST %s" % (
rule = "mkfunc ::= %s%sload_closure LOAD_CODE %s" % (
kwargs_str,
"expr " * args_pos,
opname,
)
elif self.version == 3.3:
rule = "mkfunc ::= %s%sload_closure LOAD_CONST LOAD_STR %s" % (
rule = "mkfunc ::= %s%sload_closure LOAD_CODE LOAD_STR %s" % (
kwargs_str,
"expr " * args_pos,
opname,
)
elif self.version >= 3.4:
rule = "mkfunc ::= %s%s load_closure LOAD_CONST LOAD_STR %s" % (
rule = "mkfunc ::= %s%s load_closure LOAD_CODE LOAD_STR %s" % (
"expr " * args_pos,
kwargs_str,
opname,
@@ -1043,7 +1043,7 @@ class Python3Parser(PythonParser):
self.add_unique_rule(rule, opname, token.attr, customize)
if self.version < 3.4:
rule = "mkfunc ::= %sload_closure LOAD_CONST %s" % (
rule = "mkfunc ::= %sload_closure LOAD_CODE %s" % (
"expr " * args_pos,
opname,
)
@@ -1083,7 +1083,7 @@ class Python3Parser(PythonParser):
rule = "mkfunc ::= %s%s%s%s" % (
"expr " * stack_count,
"load_closure " * closure,
"LOAD_CONST LOAD_STR ",
"LOAD_CODE LOAD_STR ",
opname,
)
self.add_unique_rule(rule, opname, token.attr, customize)
@@ -1186,13 +1186,13 @@ class Python3Parser(PythonParser):
rule = "mkfunc ::= %s %s%s%s" % (
kwargs,
"pos_arg " * args_pos,
"LOAD_CONST ",
"LOAD_CODE ",
opname,
)
self.add_unique_rule(rule, opname, token.attr, customize)
rule = "mkfunc ::= %s%s%s" % (
"pos_arg " * args_pos,
"LOAD_CONST ",
"LOAD_CODE ",
opname,
)
elif self.version == 3.3:
@@ -1200,7 +1200,7 @@ class Python3Parser(PythonParser):
rule = "mkfunc ::= %s %s%s%s" % (
kwargs,
"pos_arg " * args_pos,
"LOAD_CONST LOAD_STR ",
"LOAD_CODE LOAD_STR ",
opname,
)
elif self.version > 3.5:
@@ -1208,7 +1208,7 @@ class Python3Parser(PythonParser):
rule = "mkfunc ::= %s%s %s%s" % (
"pos_arg " * args_pos,
kwargs,
"LOAD_CONST LOAD_STR ",
"LOAD_CODE LOAD_STR ",
opname,
)
elif self.version > 3.3:
@@ -1216,7 +1216,7 @@ class Python3Parser(PythonParser):
rule = "mkfunc ::= %s%s %s%s" % (
"pos_arg " * args_pos,
kwargs,
"LOAD_CONST LOAD_STR ",
"LOAD_CODE LOAD_STR ",
opname,
)
else: