docs: def parse_pseudo_nth(self, sel, m, has_selector, iselector):
          """Parse `nth` pseudo."""
  
          mdict = m.groupdict()
          if mdict.get('pseudo_nth_child'):
              postfix = '_child'
          else:
              postfix = '_type'
          mdict['name'] = util.lower(css_unescape(mdict['name']))
          content = util.lower(mdict.get('nth' + postfix))
          if content == 'even':
              # 2n
              s1 = 2
              s2 = 0
              var = True
          elif content == 'odd':
              # 2n+1
              s1 = 2
              s2 = 1
              var = True
          else:
              nth_parts = RE_NTH.match(content)
              s1 = '-' if nth_parts.group('s1') and nth_parts.group('s1') == '-' else ''
              a = nth_parts.group('a')
              var = a.endswith('n')
              if a.startswith('n'):
                  s1 += '1'
              elif var:
                  s1 += a[:-1]
              else:
                  s1 += a
              s2 = '-' if nth_parts.group('s2') and nth_parts.group('s2') == '-' else ''
              if nth_parts.group('b'):
                  s2 += nth_parts.group('b')
              else:
                  s2 = '0'
              s1 = int(s1, 10)
              s2 = int(s2, 10)
  
          pseudo_sel = mdict['name']
          if postfix == '_child':
              if m.group('of'):
                  # Parse the rest of `of S`.
                  nth_sel = self.parse_selectors(iselector, m.end(0), FLG_PSEUDO | FLG_OPEN)
              else:
                  # Use default `*|*` for `of S`.
                  nth_sel = CSS_NTH_OF_S_DEFAULT
              if pseudo_sel == ':nth-child':
                  sel.nth.append(ct.SelectorNth(s1, var, s2, False, False, nth_sel))
              elif pseudo_sel == ':nth-last-child':
                  sel.nth.append(ct.SelectorNth(s1, var, s2, False, True, nth_sel))
          else:
              if pseudo_sel == ':nth-of-type':
                  sel.nth.append(ct.SelectorNth(s1, var, s2, True, False, ct.SelectorList()))
              elif pseudo_sel == ':nth-last-of-type':
                  sel.nth.append(ct.SelectorNth(s1, var, s2, True, True, ct.SelectorList()))
          has_selector = True
          return has_selector