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.

Type Bound

json_core

Arguments

Type IntentOptional Attributes Name
class(json_core), intent(inout) :: json

Called by

proc~~json_prepare_parser~~CalledByGraph proc~json_prepare_parser json_core%json_prepare_parser proc~json_parse_file json_core%json_parse_file proc~json_parse_file->proc~json_prepare_parser proc~json_parse_string json_core%json_parse_string proc~json_parse_string->proc~json_prepare_parser none~deserialize~2 json_core%deserialize none~deserialize~2->proc~json_parse_string none~load~2 json_core%load none~load~2->proc~json_parse_file proc~json_file_load json_file%json_file_load proc~json_file_load->none~load~2 proc~json_file_load_from_string json_file%json_file_load_from_string proc~json_file_load_from_string->none~deserialize~2 proc~wrap_json_parse_string wrap_json_parse_string proc~wrap_json_parse_string->none~deserialize~2 none~deserialize json_file%deserialize none~deserialize->proc~json_file_load_from_string proc~assign_string_to_json_file json_file%assign_string_to_json_file proc~assign_string_to_json_file->none~deserialize proc~initialize_json_file_from_string initialize_json_file_from_string proc~initialize_json_file_from_string->none~deserialize proc~initialize_json_file_from_string_v2 initialize_json_file_from_string_v2 proc~initialize_json_file_from_string_v2->none~deserialize proc~wrap_json_file_load_from_string wrap_json_file_load_from_string proc~wrap_json_file_load_from_string->none~deserialize interface~json_file json_file interface~json_file->proc~initialize_json_file_from_string interface~json_file->proc~initialize_json_file_from_string_v2 proc~wrap_assign_string_to_json_file wrap_assign_string_to_json_file proc~wrap_assign_string_to_json_file->proc~assign_string_to_json_file proc~wrap_initialize_json_file_from_string wrap_initialize_json_file_from_string proc~wrap_initialize_json_file_from_string->proc~initialize_json_file_from_string proc~wrap_initialize_json_file_from_string_v2 wrap_initialize_json_file_from_string_v2 proc~wrap_initialize_json_file_from_string_v2->proc~initialize_json_file_from_string_v2

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