def _finish_recording_macros(self):
        new_rules = []
        for rule_name, macro in self._recording_macros.items():
            rule_name = '{} [<num>]'.format(rule_name)
            new_rules.append(ruleparser.Rule(rule_name, macro[:-1] + [dynamic.Num(-1).add(-1)], self))
        for rule in self._rules:
            if rule.pattern_text not in [r.pattern_text for r in new_rules]:
                new_rules.append(rule)
        self._rules = new_rules
        self._recording_macros = {}
dataset/ETHPy150Open evfredericksen/pynacea/pynhost/pynhost/grammarbase.py/GrammarBase._finish_recording_macros/original