mklambda -> lambda_body matches Python AST better

Note: we can't use "lambda" since that is a reserved word
This commit is contained in:
rocky
2021-12-26 18:48:51 -05:00
parent 23551ea70f
commit 3234673422
12 changed files with 31 additions and 31 deletions

View File

@@ -103,7 +103,7 @@ class Python2Parser(PythonParser):
delete_subscript ::= expr expr DELETE_SUBSCR
delete ::= expr DELETE_ATTR
_mklambda ::= load_closure mklambda
_lambda_body ::= load_closure lambda_body
kwarg ::= LOAD_CONST expr
kv3 ::= expr expr STORE_MAP
@@ -540,7 +540,7 @@ class Python2Parser(PythonParser):
elif opname_base == "MAKE_FUNCTION":
if i > 0 and tokens[i - 1] == "LOAD_LAMBDA":
self.addRule(
"mklambda ::= %s LOAD_LAMBDA %s"
"lambda_body ::= %s LOAD_LAMBDA %s"
% ("pos_arg " * token.attr, opname),
nop_func,
)
@@ -549,7 +549,7 @@ class Python2Parser(PythonParser):
# FIXME: use add_unique_rules to tidy this up.
if i > 0 and tokens[i - 1] == "LOAD_LAMBDA":
self.addRule(
"mklambda ::= %s load_closure LOAD_LAMBDA %s"
"lambda_body ::= %s load_closure LOAD_LAMBDA %s"
% ("expr " * token.attr, opname),
nop_func,
)