docs: def parse_extends(self):
          """
          For each part, create the inheritance parts from the ' extends '
          """
          # To be able to manage multiple extends, you need to
          # destroy the actual node and create many nodes that have
          # mono extend. The first one gets all the css rules
          for _selectors, rules in self.parts.items():
              if ' extends ' in _selectors:
                  selectors, _, parent = _selectors.partition(' extends ')
                  parents = parent.split('&')
                  del self.parts[_selectors]
                  for parent in parents:
                      new_selectors = selectors + ' extends ' + parent
                      self.parts.setdefault(new_selectors, [])
                      self.parts[new_selectors].extend(rules)
                      rules = []
                          # further rules extending other parents will be empty
  
          cnt = 0
          parents_left = True
          while parents_left and cnt < 10:
              cnt += 1
              parents_left = False
              for _selectors in self.parts.keys():
                  selectors, _, parent = _selectors.partition(' extends ')
                  if parent:
                      parents_left = True
                      if _selectors not in self.parts:
                          continue  # Nodes might have been renamed while linking parents...
  
                      rules = self.parts[_selectors]
  
                      del self.parts[_selectors]
                      self.parts.setdefault(selectors, [])
                      self.parts[selectors].extend(rules)
  
                      parents = self.link_with_parents(parent, selectors, rules)
  
                      if parents is None:
                          log.warn("Parent rule not found: %s", parent)
                      else:
                          # from the parent, inherit the context and the options:
                          new_context = {}
                          new_options = {}
                          for parent in parents:
                              new_context.update(parent[CONTEXT])
                              new_options.update(parent[OPTIONS])
                          for rule in rules:
                              _new_context = new_context.copy()
                              _new_context.update(rule[CONTEXT])
                              rule[CONTEXT] = _new_context
                              _new_options = new_options.copy()
                              _new_options.update(rule[OPTIONS])
                              rule[OPTIONS] = _new_options