@@ -8776,9 +8776,14 @@ subroutine annotate_invalid_json(json,iunit,str)
8776
8776
integer (IK),intent (in ) :: iunit ! ! file unit number
8777
8777
character (kind= CK,len=* ),intent (in ) :: str ! ! string with JSON data
8778
8778
8779
- character (kind= CK,len= :),allocatable :: line, arrow_str
8780
- character (kind= CK,len= 10 ) :: line_str, char_str
8781
- integer (IK) :: i, i_nl_prev, i_nl
8779
+ character (kind= CK,len= :),allocatable :: line ! ! line containing the error
8780
+ character (kind= CK,len= :),allocatable :: arrow_str ! ! arrow string that points
8781
+ ! ! to the current character
8782
+ character (kind= CK,len= max_integer_str_len) :: line_str ! ! current line number string
8783
+ character (kind= CK,len= max_integer_str_len) :: char_str ! ! current character count string
8784
+ integer (IK) :: i ! ! line number counter
8785
+ integer (IK) :: i_nl_prev ! ! index of previous newline character
8786
+ integer (IK) :: i_nl ! ! index of current newline character
8782
8787
8783
8788
! If there was an error reading the file, then
8784
8789
! print the line where the error occurred:
@@ -8896,8 +8901,10 @@ subroutine get_current_line_from_file_stream(json,iunit,line)
8896
8901
integer (IK),intent (in ) :: iunit ! ! file unit number
8897
8902
character (kind= CK,len= :),allocatable ,intent (out ) :: line ! ! current line
8898
8903
8899
- integer (IK) :: istart,iend,ios
8900
- character (kind= CK,len= 1 ) :: c
8904
+ integer (IK) :: istart ! ! start position of current line
8905
+ integer (IK) :: iend ! ! end position of current line
8906
+ integer (IK) :: ios ! ! file read `iostat` code
8907
+ character (kind= CK,len= 1 ) :: c ! ! a character read from the file
8901
8908
8902
8909
istart = json% ipos
8903
8910
do
@@ -8934,11 +8941,13 @@ recursive subroutine parse_value(json, unit, str, value)
8934
8941
8935
8942
class(json_core),intent (inout ) :: json
8936
8943
integer (IK),intent (in ) :: unit ! ! file unit number
8937
- character (kind= CK,len=* ),intent (in ) :: str ! ! string containing JSON data (only used if unit=0)
8944
+ character (kind= CK,len=* ),intent (in ) :: str ! ! string containing JSON
8945
+ ! ! data (only used if `unit=0`)
8938
8946
type (json_value),pointer :: value ! ! JSON data that is extracted
8939
8947
8940
8948
logical (LK) :: eof ! ! end-of-file flag
8941
- character (kind= CK,len= 1 ) :: c ! ! character read from file (or string) by [[pop_char]]
8949
+ character (kind= CK,len= 1 ) :: c ! ! character read from file
8950
+ ! ! (or string) by [[pop_char]]
8942
8951
#if defined __GFORTRAN__
8943
8952
character (kind= CK,len= :),allocatable :: tmp ! ! this is a work-around for a bug
8944
8953
! ! in the gfortran 4.9 compiler.
@@ -10051,7 +10060,7 @@ end subroutine parse_number
10051
10060
! * [[push_char]]
10052
10061
!
10053
10062
! @note This routine ignores non-printing ASCII characters
10054
- ! (iachar<=31) that are in strings.
10063
+ ! (` iachar<=31` ) that are in strings.
10055
10064
10056
10065
recursive subroutine pop_char (json ,unit ,str ,skip_ws ,skip_comments ,eof ,popped )
10057
10066
@@ -10061,7 +10070,7 @@ recursive subroutine pop_char(json,unit,str,skip_ws,skip_comments,eof,popped)
10061
10070
integer (IK),intent (in ) :: unit ! ! file unit number (if parsing
10062
10071
! ! from a file)
10063
10072
character (kind= CK,len=* ),intent (in ) :: str ! ! JSON string (if parsing from a
10064
- ! ! string) -- only used if unit=0
10073
+ ! ! string) -- only used if ` unit=0`
10065
10074
logical (LK),intent (in ),optional :: skip_ws ! ! to ignore whitespace [default False]
10066
10075
logical (LK),intent (in ),optional :: skip_comments ! ! to ignore comment lines [default False]
10067
10076
logical (LK),intent (out ) :: eof ! ! true if the end of the file has
0 commit comments