json_prepare_parser Subroutine

private subroutine json_prepare_parser(json)

Internal routine to be called before parsing JSON. Currently, all this does it allocate the comment_char if none was specified.

Arguments

Type IntentOptional AttributesName
class(json_core), intent(inout) :: json

Contents

Source Code


Source Code

    subroutine json_prepare_parser(json)

    implicit none

    class(json_core),intent(inout) :: json

    if (json%allow_comments .and. .not. allocated(json%comment_char)) then
        ! comments are enabled, but user hasn't set the comment char,
        ! so in this case use the default:
        json%comment_char = CK_'/!#'
    end if

    end subroutine json_prepare_parser