From 207dc0b506a60fdc3cc22264733f79d95ebcfc83 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 5 Nov 2022 19:18:27 -0400 Subject: [PATCH] opc field in while1 reduction is off of token... not self (parse) --- test/bytecode_3.7/02_while1_if_while1.pyc | Bin 0 -> 357 bytes uncompyle6/parsers/reducecheck/while1stmt.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 test/bytecode_3.7/02_while1_if_while1.pyc diff --git a/test/bytecode_3.7/02_while1_if_while1.pyc b/test/bytecode_3.7/02_while1_if_while1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e8cf9176289d4d247059008a59b445a02ecf069 GIT binary patch literal 357 zcmYjNJxc>Y5S`gQ@r+5T6jqW-I29AMR74cpAX)@$mgII%5ASm~M^1>1_!sO=>0jE` z%D<4x*;B!R_x24tZyviBolXm=W^e1$Jp}l4&0jGR=LEA)RBtQLTXm1PdkqR-u=K}J zvPQ8nNRapncTBQd2zcncuH4B9mjtszRQDGs@zK-$1-ye~OKcQMzQkuNn@zOA8-39* zSXkjn!0cL>SJ}*ZQJhI?(O9lB`2pIeq1CR5(;`vAPqWeH}_56KiVLV^-t4W TR*5=uk2PH)h93T)#eDt^E%r`H literal 0 HcmV?d00001 diff --git a/uncompyle6/parsers/reducecheck/while1stmt.py b/uncompyle6/parsers/reducecheck/while1stmt.py index 43d3b752..1570f1bb 100644 --- a/uncompyle6/parsers/reducecheck/while1stmt.py +++ b/uncompyle6/parsers/reducecheck/while1stmt.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Rocky Bernstein +# Copyright (c) 2020, 2022 Rocky Bernstein def while1stmt(self, lhs, n, rule, ast, tokens, first, last): @@ -42,7 +42,7 @@ def while1stmt(self, lhs, n, rule, ast, tokens, first, last): # token could be a pseudo-op like "LOAD_STR", which is not in # self.opc. We will replace that with LOAD_CONST as an # example of an instruction that is not in self.opc.JUMP_OPS - if self.opc.opmap.get(token.kind, "LOAD_CONST") in self.opc.JUMP_OPS: + if token.opc.opmap.get(token.kind, "LOAD_CONST") in self.opc.JUMP_OPS: if token.attr >= loop_end_offset: return True