Skip to content

Commit

Permalink
support pushfirst!(parent::Node, child::Node)
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi authored Nov 1, 2024
1 parent 58f1b5a commit cf2dc30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/XML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Base.parse(x::AbstractString, ::Type{Node}) = Node(parse(x, Raw))

Base.setindex!(o::Node, val, i::Integer) = o.children[i] = Node(val)
Base.push!(a::Node, b::Node) = push!(a.children, b)
Base.pushfirst!(a::Node, b::Node) = pushfirst!(a.children, b)

Base.setindex!(o::Node, val, key::AbstractString) = (o.attributes[key] = string(val))
Base.getindex(o::Node, val::AbstractString) = o.attributes[val]
Expand Down

0 comments on commit cf2dc30

Please sign in to comment.