You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
remove \n in lambda; 2.6 grammar cleanup
This commit is contained in:
@@ -312,11 +312,6 @@ class Python26Parser(Python2Parser):
|
||||
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP
|
||||
jmp_false_then compare_chained2 _come_froms
|
||||
|
||||
return_lambda ::= RETURN_VALUE
|
||||
return_lambda ::= RETURN_END_IF
|
||||
return_lambda ::= RETURN_END_IF_LAMBDA
|
||||
return_lambda ::= RETURN_VALUE_LAMBDA
|
||||
|
||||
compare_chained2 ::= expr COMPARE_OP return_expr_lambda
|
||||
compare_chained2 ::= expr COMPARE_OP RETURN_END_IF_LAMBDA
|
||||
compare_chained2 ::= expr COMPARE_OP RETURN_END_IF COME_FROM
|
||||
|
@@ -1167,11 +1167,8 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
||||
# f'{(lambda x:x)("8")!r}'
|
||||
# Adding a "\n" after "lambda x: x" will give an error message:
|
||||
# SyntaxError: f-string expression part cannot include a backslash
|
||||
# So avoid that.
|
||||
printfn = (
|
||||
self.write if self.in_format_string and is_lambda else self.println
|
||||
)
|
||||
printfn(self.text)
|
||||
# So avoid \n after writing text
|
||||
self.write(self.text)
|
||||
self.name = old_name
|
||||
self.return_none = rn
|
||||
|
||||
|
Reference in New Issue
Block a user