def []=(range, value)
i_b = @list.bsearch_index {|e| e.range.last > range.first } || @list.size
i_e = @list.bsearch_index {|e| e.range.first >= range.last } || @list.size
if i_b < i_e
if i_e - i_b == 1
if range.contain?(@list[i_b].range)
@list[i_b] = Entry[range, value, CodeRangeTable.new(@list[i_b, 1])]
elsif @list[i_b].range.contain?(range)
@list[i_b].children[range] = value
else
raise
end
else
if range.contain?(@list[i_b].range) && range.contain?(@list[i_e - 1].range)
@list[i_b...i_e] = [Entry[range, value, CodeRangeTable.new(@list[i_b...i_e])]]
else
raise
end
end
else
@list[i_b, 0] = [Entry[range, value, CodeRangeTable.new]]
end
end