code: def delete(self):
          r
  
          # TODO: needs better abstraction for supports contents
          parent = self.parent
          if parent.expr._supports_contents():
              parent.remove(self)
              return
  
          # TODO: needs abstraction for removing from arg
          for arg in parent.args:
              if self.expr in arg.contents:
                  arg.contents.remove(self.expr)
docs: r"""Delete this node from the parse tree.
  
          Where applicable, this will remove all descendants of this node from
          the parse tree.
  
          >>> from TexSoup import TexSoup
          >>> soup = TexSoup(r'''\textit{\color{blue}{Silly}}\textit{keep me!}''')
          >>> soup.textit.color.delete()
          >>> soup
          \textit{}\textit{keep me!}
          >>> soup.textit.delete()
          >>> soup
          \textit{keep me!}