def METHOD_NAME(s: str) -> str:
  state = 0
  escape = False
  out = ""
  for c in s:
    if state == 0:    # before string
      if c == '"':      # entering string
        out = '"'
        state = 1
      elif c == '/':    # start of comment before entering string
        state = 99      # we're done
    elif state == 1:  # in string
      if escape:        # escaped char
        out += '\\' + c
        escape = False
      elif c == '\\':   # escaped char
        escape = True
      elif c == '"':    # end of string
        out += '"'
        state = 99      # we're done
      else:
        out += c
  return out