You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
remove \n in lambda; 2.6 grammar cleanup
This commit is contained in:
@@ -42,7 +42,7 @@ SKIP_TESTS=(
|
|||||||
[test_decimal.py]=1 #
|
[test_decimal.py]=1 #
|
||||||
[test_dis.py]=1 # We change line numbers - duh!
|
[test_dis.py]=1 # We change line numbers - duh!
|
||||||
[test_generators.py]=1 # Investigate
|
[test_generators.py]=1 # Investigate
|
||||||
[test_grammar.py]=1 # Too many stmts. Handle large stmts
|
# [test_grammar.py]=1 # fails on its own - no module tests.test_support
|
||||||
[test_grp.py]=1 # Long test - might work Control flow?
|
[test_grp.py]=1 # Long test - might work Control flow?
|
||||||
[test_pep247.py]=1 # Long test - might work? Control flow?
|
[test_pep247.py]=1 # Long test - might work? Control flow?
|
||||||
[test_socketserver.py]=1 # -- test takes too long to run: 40 seconds
|
[test_socketserver.py]=1 # -- test takes too long to run: 40 seconds
|
||||||
|
@@ -44,7 +44,7 @@ SKIP_TESTS=(
|
|||||||
[test_dis.py]=1 # We change line numbers - duh!
|
[test_dis.py]=1 # We change line numbers - duh!
|
||||||
[test_file.py]=1 # test assertion failures
|
[test_file.py]=1 # test assertion failures
|
||||||
[test_generators.py]=1 # Investigate
|
[test_generators.py]=1 # Investigate
|
||||||
[test_grammar.py]=1 # Too many stmts. Handle large stmts
|
# [test_grammar.py]=1 # fails on its own - no module tests.test_support
|
||||||
[test_grp.py]=1 # Long test - might work Control flow?
|
[test_grp.py]=1 # Long test - might work Control flow?
|
||||||
[test_macfs.py]=1 # it fails on its own
|
[test_macfs.py]=1 # it fails on its own
|
||||||
[test_macostools.py]=1 # it fails on its own
|
[test_macostools.py]=1 # it fails on its own
|
||||||
|
@@ -9,7 +9,6 @@ SKIP_TESTS=(
|
|||||||
[test_doctest.py]=1 # Fails on its own
|
[test_doctest.py]=1 # Fails on its own
|
||||||
[test_exceptions.py]=1
|
[test_exceptions.py]=1
|
||||||
[test_format.py]=1 # Control flow "and" vs nested "if"
|
[test_format.py]=1 # Control flow "and" vs nested "if"
|
||||||
[test_grammar.py]=1 # Too many stmts. Handle large stmts
|
|
||||||
[test_grp.py]=1 # test takes to long, works interactively though
|
[test_grp.py]=1 # test takes to long, works interactively though
|
||||||
[test_io.py]=1 # Test takes too long to run
|
[test_io.py]=1 # Test takes too long to run
|
||||||
[test_ioctl.py]=1 # Test takes too long to run
|
[test_ioctl.py]=1 # Test takes too long to run
|
||||||
|
@@ -312,11 +312,6 @@ class Python26Parser(Python2Parser):
|
|||||||
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP
|
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP
|
||||||
jmp_false_then compare_chained2 _come_froms
|
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_expr_lambda
|
||||||
compare_chained2 ::= expr COMPARE_OP RETURN_END_IF_LAMBDA
|
compare_chained2 ::= expr COMPARE_OP RETURN_END_IF_LAMBDA
|
||||||
compare_chained2 ::= expr COMPARE_OP RETURN_END_IF COME_FROM
|
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}'
|
# f'{(lambda x:x)("8")!r}'
|
||||||
# Adding a "\n" after "lambda x: x" will give an error message:
|
# Adding a "\n" after "lambda x: x" will give an error message:
|
||||||
# SyntaxError: f-string expression part cannot include a backslash
|
# SyntaxError: f-string expression part cannot include a backslash
|
||||||
# So avoid that.
|
# So avoid \n after writing text
|
||||||
printfn = (
|
self.write(self.text)
|
||||||
self.write if self.in_format_string and is_lambda else self.println
|
|
||||||
)
|
|
||||||
printfn(self.text)
|
|
||||||
self.name = old_name
|
self.name = old_name
|
||||||
self.return_none = rn
|
self.return_none = rn
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user