code: def _references(self, i, sequence=False):
          
  
          value = ''
          c = next(i)
          if c == '\\':
              # \\
              if sequence and self.bslash_abort:
                  raise PathNameException
              value = r'\\'
              if self.bslash_abort:
                  if not self.in_list:
                      value = self.get_path_sep() + _ONE_OR_MORE
                      self.set_start_dir()
                  else:
                      value = self._restrict_extended_slash() + value
          elif c == '/':
              # \/
              if sequence and self.pathname:
                  raise PathNameException
              if self.pathname:
                  value = r'\\'
                  if self.in_list:
                      value = self._restrict_extended_slash() + value
                  i.rewind(1)
              else:
                  value = re.escape(c)
          else:
              # \a, \b, \c, etc.
              value = re.escape(c)
              if c == '.' and self.after_start and self.in_list:
                  self.allow_special_dir = True
                  self.reset_dir_track()
  
          return value
docs: Handle references.