(self, node: Alt, is_gather: bool, rulename: str | None)
| 779 | self.print("_res = _PyPegen_dummy_name(p);") |
| 780 | |
| 781 | def handle_alt_normal(self, node: Alt, is_gather: bool, rulename: str | None) -> None: |
| 782 | self.join_conditions(keyword="if", node=node) |
| 783 | self.print("{") |
| 784 | # We have parsed successfully all the conditions for the option. |
| 785 | with self.indent(): |
| 786 | node_str = str(node).replace('"', '\\"') |
| 787 | self.print( |
| 788 | f'D(fprintf(stderr, "%*c+ {rulename}[%d-%d]: %s succeeded!\\n", p->level, \' \', _mark, p->mark, "{node_str}"));' |
| 789 | ) |
| 790 | # Prepare to emit the rule action and do so |
| 791 | if node.action and "EXTRA" in node.action: |
| 792 | self._set_up_token_end_metadata_extraction() |
| 793 | if self.skip_actions: |
| 794 | self.emit_dummy_action() |
| 795 | elif node.action: |
| 796 | self.emit_action(node) |
| 797 | else: |
| 798 | self.emit_default_action(is_gather, node) |
| 799 | |
| 800 | # As the current option has parsed correctly, do not continue with the rest. |
| 801 | self.print("goto done;") |
| 802 | self.print("}") |
| 803 | |
| 804 | def handle_alt_loop(self, node: Alt, is_gather: bool, rulename: str | None) -> None: |
| 805 | # Condition of the main body of the alternative |
no test coverage detected