def remove_super_init_call_modifier(node: LN, capture: Capture,
                                     filename: Filename) -> None:
     for ch in node.post_order():
         if isinstance(ch, Leaf) and ch.value == "super":
             if any(c.value for c in ch.parent.post_order()
                    if isinstance(c, Leaf)):
                 ch.parent.remove()
Example #2
0
 def _remover(node: LN, capture: Capture, filename: Filename) -> None:
     if node.type == 300:
         for ch in node.post_order():
             if isinstance(ch, Leaf) and ch.value == class_name:
                 if ch.next_sibling and ch.next_sibling.value == ",":
                     ch.next_sibling.remove()
                 ch.remove()
     elif node.type == 311:
         node.parent.remove()
     else:
         node.remove()