(self, rule, ast, tokens, first, last)
| 597 | self.addRule(rules_str, nop_func) |
| 598 | |
| 599 | def reduce_is_invalid(self, rule, ast, tokens, first, last): |
| 600 | invalid = super(Python38Parser, self).reduce_is_invalid( |
| 601 | rule, ast, tokens, first, last |
| 602 | ) |
| 603 | self.remove_rules_38() |
| 604 | if invalid: |
| 605 | return invalid |
| 606 | lhs = rule[0] |
| 607 | if lhs in ("whileTruestmt38", "whilestmt38"): |
| 608 | jb_index = last - 1 |
| 609 | while jb_index > 0 and tokens[jb_index].kind.startswith("COME_FROM"): |
| 610 | jb_index -= 1 |
| 611 | t = tokens[jb_index] |
| 612 | if t.kind != "JUMP_BACK": |
| 613 | return True |
| 614 | return t.attr != tokens[first].off2int() |
| 615 | pass |
| 616 | |
| 617 | return False |
| 618 | |
| 619 | |
| 620 | class Python38ParserSingle(Python38Parser, PythonParserSingle): |
nothing calls this directly
no test coverage detected