def parse_quoted_attribute(quote)
      value, count = '', 0

      until @line.empty? || (count == 0 && @line[0] == quote[0])
        if count > 0
          if @line[0] == ?{
            count += 1
          elsif @line[0] == ?}
            count -= 1
          end
        elsif @line =~ /\A#\{/
          value << @line.slice!(0)
          count = 1
        end
        value << @line.slice!(0)
      end

      syntax_error!("Expected closing brace }") if count != 0
      @line.slice!(0)
      value
    end
def parse_quoted_attribute(quote)
      value, count = '', 0

      until @line.empty? || (count == 0 && @line[0] == quote[0])
        if count > 0
          if @line[0] == ?{
            count += 1
          elsif @line[0] == ?}
            count -= 1
          end
        elsif @line =~ /\A#\{/
          value << @line.slice!(0)
          count = 1
        end
        value << @line.slice!(0)
      end

      syntax_error!("Expected closing brace }") if count != 0
      @line.slice!(0)
      value
    end
=begin
    def parse_ruby_attribute(outer_delimiter)
      value, count, delimiter, close_delimiter = '', 0, nil, nil

      # Attribute ends with space or attribute delimiter
      end_regex = /\A[\s#{Regexp.escape outer_delimiter.to_s}]/

      until @line.empty? || (count == 0 && @line =~ end_regex)
        if count > 0
          if @line[0] == delimiter[0]
            count += 1
          elsif @line[0] == close_delimiter[0]
            count -= 1
          end
        elsif @line =~ DELIMITER_REGEX
          count = 1
          delimiter, close_delimiter = $&, DELIMITERS[$&]
        end
        value << @line.slice!(0)
      end

      syntax_error!("Expected closing attribute delimiter #{close_delimiter}") if count != 0
      syntax_error!('Invalid empty attribute') if value.empty?

      # Remove attribute wrapper which doesn't belong to the ruby code
      # e.g id=[hash[:a] + hash[:b]]
      value = value[1..-2] if value =~ DELIMITER_REGEX &&
        DELIMITERS[$&] == value[-1, 1]

      value
    end
=end