Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | intent(inout), | pointer | :: | me | ||
type(json_value), | intent(inout), | pointer | :: | member | the child member to add |
Adds "member" as a child of "me".
subroutine json_value_add_member(me, member)
implicit none
type(json_value),pointer :: me
type(json_value),pointer :: member !! the child member to add
if (.not. exception_thrown) then
! associate the parent
member%parent => me
! add to linked list
if (associated(me%children)) then
me%tail%next => member
member%previous => me%tail
else
me%children => member
member%previous => null() !first in the list
end if
! new member is now the last one in the list
me%tail => member
me%n_children = me%n_children + 1
end if
end subroutine json_value_add_member