Skip to content

Commit

Permalink
removed debug prints and some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwilliams committed May 19, 2024
1 parent a6acfce commit f33d2b0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/json_value_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9553,33 +9553,25 @@ recursive subroutine json_traverse(json,p,traverse_callback)
type(json_value),pointer :: element !! a child element
integer(IK) :: i !! counter
integer(IK) :: icount !! number of children

logical(LK) :: finished !! can be used to stop the process

if (json%exception_thrown) return

!! recursive [[json_value]] traversal.

if (json%exception_thrown) return
call traverse_callback(json,p,finished) ! first call for this object
if (finished) return

!for arrays and objects, have to also call for all children:
if (p%var_type==json_array .or. p%var_type==json_object) then

print *, loc(p), associated(p)
icount = json%count(p) ! number of children
print *, icount
if (icount>0) then
print *, icount, ">0"
element => p%children ! first one
do i = 1, icount ! call for each child
if (.not. associated(element)) then
call json%throw_exception('Error in json_traverse: '//&
'Malformed JSON linked list')
return
end if
call json%traverse(element, traverse_callback)
call json%traverse(element, traverse_callback) ! this is json_traverse
if (finished .or. json%exception_thrown) exit
element => element%next
end do
Expand Down

0 comments on commit f33d2b0

Please sign in to comment.