Core routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
character(kind=CK,len=1), | intent(in) | :: | c |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
subroutine push_char(json,c)
implicit none
class(json_core),intent(inout) :: json
character(kind=CK,len=1),intent(in) :: c
character(kind=CK,len=max_numeric_str_len) :: istr
if (.not. json%exception_thrown) then
if (use_unformatted_stream) then
!in this case, c is ignored, and we just
!decrement the stream position counter:
json%ipos = json%ipos - 1
else
json%pushed_index = json%pushed_index + 1
if (json%pushed_index>0 .and. json%pushed_index<=len(json%pushed_char)) then
json%pushed_char(json%pushed_index:json%pushed_index) = c
else
call integer_to_string(json%pushed_index,int_fmt,istr)
call json%throw_exception('Error in push_char: '//&
'invalid valid of pushed_index: '//trim(istr))
end if
end if
end if
end subroutine push_char