def group_values_for_sort(values)
      sorted_values = values.sort_by(&:key)
      [].tap do |value_groups|
        until sorted_values.empty?
          key = sorted_values.first.key
          value_group, sorted_values = sorted_values.partition { |v| v.key.start_with?(key) }
          value_groups << value_group
        end
      end
    end
def group_values_for_sort(values)
      sorted_values = values.sort_by(&:key)
      [].tap do |value_groups|
        until sorted_values.empty?
          key = sorted_values.first.key
          value_group, sorted_values = sorted_values.partition { |v| v.key.start_with?(key) }
          value_groups << value_group
        end
      end
    end
Build array of grouped values whose sort order may go back and forth, which is also sorted with key name.
 This method needs to group values with the same start because it can be changed in `Haml::AttributeBuidler#build_data_keys`.
 @param values [Array<Haml::AttributeCompiler::AttributeValue>]
 @return [Array<Array<Haml::AttributeCompiler::AttributeValue>>]