@@ -10985,60 +10985,53 @@ subroutine parse_number(json, unit, str, value)
1098510985 ! get the next character:
1098610986 call json% pop_char(unit, str= str, eof= eof, skip_ws= .true. , popped= c)
1098710987
10988- if (eof) then
10989- call json% throw_exception(' Error in parse_number:' // &
10990- ' Unexpected end of file while parsing number.' )
10991- return
10992- else
10993-
10994- select case (c)
10995- case (CK_' -' ,CK_' +' ) ! note: allowing a '+' as the first character here.
10988+ select case (c)
10989+ case (CK_' -' ,CK_' +' ) ! note: allowing a '+' as the first character here.
1099610990
10997- if (is_integer .and. (.not. first)) is_integer = .false.
10991+ if (is_integer .and. (.not. first)) is_integer = .false.
1099810992
10999- ! add it to the string:
11000- ! tmp = tmp // c !...original
11001- if (ip> len (tmp)) tmp = tmp // blank_chunk
11002- tmp(ip:ip) = c
11003- ip = ip + 1
10993+ ! add it to the string:
10994+ ! tmp = tmp // c !...original
10995+ if (ip> len (tmp)) tmp = tmp // blank_chunk
10996+ tmp(ip:ip) = c
10997+ ip = ip + 1
1100410998
11005- case (CK_' .' ,CK_' E' ,CK_' e' ) ! can be present in real numbers
10999+ case (CK_' .' ,CK_' E' ,CK_' e' ) ! can be present in real numbers
1100611000
11007- if (is_integer) is_integer = .false.
11001+ if (is_integer) is_integer = .false.
1100811002
11009- ! add it to the string:
11010- ! tmp = tmp // c !...original
11011- if (ip> len (tmp)) tmp = tmp // blank_chunk
11012- tmp(ip:ip) = c
11013- ip = ip + 1
11003+ ! add it to the string:
11004+ ! tmp = tmp // c !...original
11005+ if (ip> len (tmp)) tmp = tmp // blank_chunk
11006+ tmp(ip:ip) = c
11007+ ip = ip + 1
1101411008
11015- case (CK_' 0' :CK_' 9' ) ! valid characters for numbers
11009+ case (CK_' 0' :CK_' 9' ) ! valid characters for numbers
1101611010
11017- ! add it to the string:
11018- ! tmp = tmp // c !...original
11019- if (ip> len (tmp)) tmp = tmp // blank_chunk
11020- tmp(ip:ip) = c
11021- ip = ip + 1
11011+ ! add it to the string:
11012+ ! tmp = tmp // c !...original
11013+ if (ip> len (tmp)) tmp = tmp // blank_chunk
11014+ tmp(ip:ip) = c
11015+ ip = ip + 1
1102211016
11023- case default
11017+ case default
1102411018
11025- ! push back the last character read:
11026- call json% push_char(c)
11019+ ! push back the last character read:
11020+ call json% push_char(c)
1102711021
11028- ! string to value:
11029- if (is_integer) then
11030- ival = json% string_to_int(tmp)
11031- call json% to_integer(value,ival)
11032- else
11033- rval = json% string_to_dble(tmp)
11034- call json% to_real(value,rval)
11035- end if
11022+ ! string to value:
11023+ if (is_integer) then
11024+ ival = json% string_to_int(tmp)
11025+ call json% to_integer(value,ival)
11026+ else
11027+ rval = json% string_to_dble(tmp)
11028+ call json% to_real(value,rval)
11029+ end if
1103611030
11037- exit ! finished
11031+ exit ! finished
1103811032
11039- end select
11033+ end select
1104011034
11041- end if
1104211035 if (first) first = .false.
1104311036
1104411037 end do
0 commit comments