def read_quoted
      logger.debug "  read quoted"
      skip_whitespace
      q = text[position] # quote character
      increase
      r = ""
      while !empty? && (c = text[position]) != q
        if c == "\\"
          increase
          c = text[position] unless empty?
          case c
          when 'r'
            c = "\r"
          when 'n'
            c = "\n"
          when '\''
            c = "\'"
          when '\\'
            c = "\\"
          else
            c = "\\" + c
          end
        end
        r << c
        increase
      end
      error("I expected #{q} but I got #{c}") if c != q
      increase
      logger.debug "  resulting string: '#{r}'"
      r
    end
def read_quoted
      logger.debug "  read quoted"
      skip_whitespace
      q = text[position] # quote character
      increase
      r = ""
      while !empty? && (c = text[position]) != q
        if c == "\\"
          increase
          c = text[position] unless empty?
          case c
          when 'r'
            c = "\r"
          when 'n'
            c = "\n"
          when '\''
            c = "\'"
          when '\\'
            c = "\\"
          else
            c = "\\" + c
          end
        end
        r << c
        increase
      end
      error("I expected #{q} but I got #{c}") if c != q
      increase
      logger.debug "  resulting string: '#{r}'"
      r
    end
rubocop:disable Metrics/PerceivedComplexity,Style/ConditionalAssignment