Skip to content

Commit 25dd67a

Browse files
committed
Clean and fix Python 3 annotate arg return
1 parent 1a38d3d commit 25dd67a

File tree

3 files changed

+190
-182
lines changed

3 files changed

+190
-182
lines changed
File renamed without changes.

uncompyle6/parsers/parse31.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def p_31(self, args):
3333
load ::= LOAD_FAST
3434
load ::= LOAD_NAME
3535
36-
stmt ::= funcdeftest
37-
funcdeftest ::= mkfunctest designator
36+
stmt ::= funcdef_annotate
37+
funcdef_annotate ::= mkfunc_annotate designator
3838
"""
3939

4040
def add_custom_rules(self, tokens, customize):
@@ -46,8 +46,9 @@ def add_custom_rules(self, tokens, customize):
4646
# Check that there are 2 annotated params?
4747
# rule = ('mkfunc2 ::= %s%sEXTENDED_ARG %s' %
4848
# ('pos_arg ' * (args_pos), 'kwargs ' * (annotate_args-1), opname))
49-
rule = ('mkfunctest ::= %s%sLOAD_CONST EXTENDED_ARG %s' %
50-
(('pos_arg ' * (args_pos)), 'kwargs ', opname))
49+
rule = ('mkfunc_annotate ::= %s%sLOAD_CONST EXTENDED_ARG %s' %
50+
(('pos_arg ' * (args_pos)),
51+
('kwargs ' * (annotate_args-1)), opname))
5152
self.add_unique_rule(rule, opname, token.attr, customize)
5253

5354
class Python31ParserSingle(Python31Parser, PythonParserSingle):

0 commit comments

Comments
 (0)