3.5 *() arg without further args

This commit is contained in:
rocky
2018-03-25 22:24:32 -04:00
parent 0b622a0ad8
commit cfb4ad625f
4 changed files with 15 additions and 3 deletions

View File

@@ -210,7 +210,6 @@ class Python35Parser(Python34Parser):
self.add_unique_rule(rule, token.kind, uniq_param, customize)
self.add_unique_rule('expr ::= async_call', token.kind, uniq_param, customize)
uniq_param = args_kw + args_pos
if opname.startswith('CALL_FUNCTION_VAR'):
# Python 3.5 changes the stack position of *args. KW args come
# after *args.
@@ -226,7 +225,10 @@ class Python35Parser(Python34Parser):
rule = ('call ::= expr expr ' +
('pos_arg ' * args_pos) +
('kwarg ' * args_kw) + kw + token.kind)
self.add_unique_rule(rule, token.kind, uniq_param, customize)
# Note: semantic actions make use of the fact of wheter "args_pos"
# zero or not in creating a template rule.
self.add_unique_rule(rule, token.kind, args_pos, customize)
else:
super(Python35Parser, self).custom_classfunc_rule(opname, token, customize,
seen_LOAD_BUILD_CLASS,