push_char Subroutine

private subroutine push_char(c)

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=1), intent(in) :: c

Description

Core routine.

See also

History

  • Jacob Williams : 5/3/2015 : replaced original version of this routine.

Calls

proc~~push_char~~CallsGraph proc~push_char push_char proc~integer_to_string integer_to_string proc~push_char->proc~integer_to_string interface~throw_exception throw_exception proc~push_char->interface~throw_exception proc~json_throw_exception json_throw_exception interface~throw_exception->proc~json_throw_exception
Help

Called By

proc~~push_char~~CalledByGraph proc~push_char push_char proc~parse_value parse_value proc~parse_value->proc~push_char proc~parse_number parse_number proc~parse_value->proc~parse_number proc~parse_object parse_object proc~parse_value->proc~parse_object proc~parse_array parse_array proc~parse_value->proc~parse_array proc~parse_number->proc~push_char proc~json_parse_string json_parse_string proc~json_parse_string->proc~parse_value proc~json_parse_file json_parse_file proc~json_parse_file->proc~parse_value proc~parse_object->proc~parse_value proc~parse_object->proc~parse_object proc~parse_array->proc~parse_value proc~wrap_json_parse_string wrap_json_parse_string proc~wrap_json_parse_string->proc~json_parse_string interface~json_parse json_parse interface~json_parse->proc~json_parse_string interface~json_parse->proc~json_parse_file proc~test_14 test_14 proc~test_14->interface~json_parse proc~test_8 test_8 proc~test_8->interface~json_parse proc~json_file_load json_file_load proc~json_file_load->interface~json_parse proc~json_file_load_from_string json_file_load_from_string proc~json_file_load_from_string->interface~json_parse program~jf_test_14 jf_test_14 program~jf_test_14->proc~test_14 program~jf_test_8 jf_test_8 program~jf_test_8->proc~test_8 proc~wrap_json_file_load_from_string wrap_json_file_load_from_string proc~wrap_json_file_load_from_string->proc~json_file_load_from_string
Help

Variables

TypeVisibility AttributesNameInitial
character(kind=CK,len=max_numeric_str_len), public :: istr

Source Code

    subroutine push_char(c)

    implicit none

    character(kind=CK,len=1),intent(in) :: c

    character(kind=CK,len=max_numeric_str_len) :: istr

    if (.not. exception_thrown) then

        if (use_unformatted_stream) then

            !in this case, c is ignored, and we just
            !decrement the stream position counter:
            ipos = ipos - 1

        else

            pushed_index = pushed_index + 1

            if (pushed_index>0 .and. pushed_index<=len(pushed_char)) then
                pushed_char(pushed_index:pushed_index) = c
            else
                call integer_to_string(pushed_index,istr)
                call throw_exception('Error in push_char: '//&
                                     'invalid valid of pushed_index: '//trim(istr))
            end if

        end if

    end if

    end subroutine push_char