MCPcopy
hub / github.com/rocky/python-uncompyle6 / add_unique_rules

Method add_unique_rules

uncompyle6/parser.py:137–147  ·  view source on GitHub ↗

Add rules (a list of string) to grammar. Note that the rules must not be those that set arg_count in the custom dictionary.

(self, rules, customize)

Source from the content-addressed store, hash-verified

135 return
136
137 def add_unique_rules(self, rules, customize):
138 """Add rules (a list of string) to grammar. Note that
139 the rules must not be those that set arg_count in the
140 custom dictionary.
141 """
142 for rule in rules:
143 if len(rule) == 0:
144 continue
145 opname = rule.split("::=")[0].strip()
146 self.add_unique_rule(rule, opname, 0, customize)
147 return
148
149 def add_unique_doc_rules(self, rules_str, customize):
150 """Add rules (a docstring-like list of rules) to grammar.

Callers 5

add_unique_doc_rulesMethod · 0.95

Calls 1

add_unique_ruleMethod · 0.95

Tested by

no test coverage detected