@@ -8052,20 +8052,14 @@ function string_to_int(json,str) result(ival)
8052
8052
8053
8053
logical (LK) :: status_ok ! ! error flag for [[string_to_integer]]
8054
8054
8055
- if (.not. json% exception_thrown) then
8056
-
8057
- ! call the core routine:
8058
- call string_to_integer(str,ival,status_ok)
8059
-
8060
- if (.not. status_ok) then
8061
- ival = 0
8062
- call json% throw_exception(' Error in string_to_int: ' // &
8063
- ' string cannot be converted to an integer: ' // &
8064
- trim (str))
8065
- end if
8055
+ ! call the core routine:
8056
+ call string_to_integer(str,ival,status_ok)
8066
8057
8067
- else
8058
+ if ( .not. status_ok) then
8068
8059
ival = 0
8060
+ call json% throw_exception(' Error in string_to_int: ' // &
8061
+ ' string cannot be converted to an integer: ' // &
8062
+ trim (str))
8069
8063
end if
8070
8064
8071
8065
end function string_to_int
@@ -8085,19 +8079,13 @@ function string_to_dble(json,str) result(rval)
8085
8079
8086
8080
logical (LK) :: status_ok ! ! error flag for [[string_to_real]]
8087
8081
8088
- if (.not. json% exception_thrown) then
8089
-
8090
- call string_to_real(str,json% use_quiet_nan,rval,status_ok)
8082
+ call string_to_real(str,json% use_quiet_nan,rval,status_ok)
8091
8083
8092
- if (.not. status_ok) then ! if there was an error
8093
- rval = 0.0_RK
8094
- call json% throw_exception(' Error in string_to_dble: ' // &
8095
- ' string cannot be converted to a real: ' // &
8096
- trim (str))
8097
- end if
8098
-
8099
- else
8084
+ if (.not. status_ok) then ! if there was an error
8100
8085
rval = 0.0_RK
8086
+ call json% throw_exception(' Error in string_to_dble: ' // &
8087
+ ' string cannot be converted to a real: ' // &
8088
+ trim (str))
8101
8089
end if
8102
8090
8103
8091
end function string_to_dble
0 commit comments