MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / add_make_function_rule

Method add_make_function_rule

uncompyle6/parsers/parse3.py:642–652  ·  view source on GitHub ↗

Python 3.3 added a an additional LOAD_STR before MAKE_FUNCTION and this has an effect on many rules.

(self, rule, opname, attr, customize)

Source from the content-addressed store, hash-verified

640 self.add_unique_rule(rule, token.kind, uniq_param, customize)
641
642 def add_make_function_rule(self, rule, opname, attr, customize):
643 """Python 3.3 added a an additional LOAD_STR before MAKE_FUNCTION and
644 this has an effect on many rules.
645 """
646 if self.version >= (3, 3):
647 load_op = "LOAD_STR "
648
649 new_rule = rule % ((load_op) * 1)
650 else:
651 new_rule = rule % (("LOAD_STR ") * 0)
652 self.add_unique_rule(new_rule, opname, attr, customize)
653
654 def customize_grammar_rules(self, tokens, customize):
655 """The base grammar we start out for a Python version even with the

Callers 1

Calls 1

add_unique_ruleMethod · 0.80

Tested by

no test coverage detected