def parse_str(io, stop_quote)
      buf = ''
      loop do
        c = io.read_one_char
        if c.nil?
          raise Error, "The IO ran out before the end of a literal string"
        elsif buf.length > 0 && buf[-1..-1] == ESC # If this char was escaped
          # Trim the escape character at the end of the buffer
          buf = buf[0..-2] 
          buf << c
        elsif c == stop_quote
          return buf
        else
          buf << c
        end
      end
    end
def parse_str(io, stop_quote)
      buf = ''
      loop do
        c = io.read_one_char
        if c.nil?
          raise Error, "The IO ran out before the end of a literal string"
        elsif buf.length > 0 && buf[-1..-1] == ESC # If this char was escaped
          # Trim the escape character at the end of the buffer
          buf = buf[0..-2] 
          buf << c
        elsif c == stop_quote
          return buf
        else
          buf << c
        end
      end
    end
Parse a string literal, in single or double quotes.