|
311 | 311 | 'whileTruestmt': ( '%|while True:\n%+%c%-\n\n', 1 ), |
312 | 312 | 'whilestmt': ( '%|while %c:\n%+%c%-\n\n', 1, 2 ), |
313 | 313 | 'while1stmt': ( '%|while 1:\n%+%c%-\n\n', 1 ), |
314 | | - 'while1elsestmt': ( '%|while 1:\n%+%c%-%|else:\n%+%c%-\n\n', 1, 3 ), |
| 314 | + 'while1elsestmt': ( '%|while 1:\n%+%c%-%|else:\n%+%c%-\n\n', 1, -2 ), |
315 | 315 | 'whileelsestmt': ( '%|while %c:\n%+%c%-%|else:\n%+%c%-\n\n', 1, 2, -2 ), |
316 | 316 | 'whileelselaststmt': ( '%|while %c:\n%+%c%-%|else:\n%+%c%-', 1, 2, -2 ), |
317 | 317 | 'forstmt': ( '%|for %c in %c:\n%+%c%-\n\n', 3, 1, 4 ), |
@@ -1010,7 +1010,10 @@ def n_exec_stmt(self, node): |
1010 | 1010 | def n_ifelsestmt(self, node, preprocess=False): |
1011 | 1011 | else_suite = node[3] |
1012 | 1012 |
|
1013 | | - n = else_suite[0] |
| 1013 | + try: |
| 1014 | + n = else_suite[0] |
| 1015 | + except: |
| 1016 | + from trepan.api import debug; debug() |
1014 | 1017 |
|
1015 | 1018 | if len(n) == 1 == len(n[0]) and n[0] == '_stmts': |
1016 | 1019 | n = n[0][0][0] |
@@ -2322,7 +2325,7 @@ def deparse_code(version, co, out=sys.stdout, showasm=None, showast=False, |
2322 | 2325 |
|
2323 | 2326 | if deparsed.ast_errors: |
2324 | 2327 | deparsed.write("# NOTE: have decompilation errors.\n") |
2325 | | - deparsed.write("# Use -t option to full context of errors.") |
| 2328 | + deparsed.write("# Use -t option to show full context.") |
2326 | 2329 | for err in deparsed.ast_errors: |
2327 | 2330 | deparsed.write(err) |
2328 | 2331 | raise SourceWalkerError("Deparsing hit an internal grammar-rule bug") |
|
0 commit comments