json_get_previous Subroutine

private subroutine json_get_previous(json, p, previous)

Returns a pointer to the previous of a json_value. If there is no previous, then a null() pointer is returned.

Arguments

TypeIntentOptionalAttributesName
class(json_core), intent(inout) :: json
type(json_value), intent(in), pointer:: p

JSON object

type(json_value), intent(out), pointer:: previous

pointer to previous


Contents

Source Code


Source Code

    subroutine json_get_previous(json,p,previous)

    implicit none

    class(json_core),intent(inout)       :: json
    type(json_value),pointer,intent(in)  :: p        !! JSON object
    type(json_value),pointer,intent(out) :: previous !! pointer to `previous`

    if (associated(p)) then
        previous => p%previous
    else
        nullify(previous)
        call json%throw_exception('Error in json_get_previous: '//&
                                  'pointer is not associated.')
    end if

    end subroutine json_get_previous