(self, node: Alt, cleanup_code: str | None = None)
| 737 | self.print(")") |
| 738 | |
| 739 | def emit_action(self, node: Alt, cleanup_code: str | None = None) -> None: |
| 740 | self.print(f"_res = {node.action};") |
| 741 | |
| 742 | self.print("if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {") |
| 743 | with self.indent(): |
| 744 | self.print("p->error_indicator = 1;") |
| 745 | if cleanup_code: |
| 746 | self.print(cleanup_code) |
| 747 | self.add_return("NULL") |
| 748 | self.print("}") |
| 749 | |
| 750 | if self.debug: |
| 751 | self.print( |
| 752 | f'D(fprintf(stderr, "Hit with action [%d-%d]: %s\\n", _mark, p->mark, "{node}"));' |
| 753 | ) |
| 754 | |
| 755 | def emit_default_action(self, is_gather: bool, node: Alt) -> None: |
| 756 | if len(self.local_variable_names) > 1: |
no test coverage detected