def add_to_current_structure(value, anchor=nil, quoted=nil, tag=nil)
value = Transform.to_proper_type(value, quoted, tag, @options)
@anchors[anchor] = value if anchor
if @result.nil?
@result = value
@current_structure = @result
return
end
if @current_structure.respond_to?(:<<)
@current_structure << value
elsif @current_structure.respond_to?(:[]=)
if @current_key.nil?
@current_key = value
else
if @current_key == "<<"
@current_structure.merge!(value)
else
@current_structure[@current_key] = value
end
@current_key = nil
end
else
raise "Don't know how to add to a #{@current_structure.class}!"
end
end