MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / reduce_is_invalid

Method reduce_is_invalid

uncompyle6/parsers/parse38.py:599–617  ·  view source on GitHub ↗
(self, rule, ast, tokens, first, last)

Source from the content-addressed store, hash-verified

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
620class Python38ParserSingle(Python38Parser, PythonParserSingle):

Callers

nothing calls this directly

Calls 2

remove_rules_38Method · 0.95
off2intMethod · 0.80

Tested by

no test coverage detected