File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,23 @@ pure function str_value_to_str(value) result(str)
4949 str = " """" "
5050end function
5151
52- subroutine parse_str (from , to , err )
52+ subroutine parse_str (from , to , err , errmsg )
5353 class(value_t), intent (in ) :: from
5454 character (len= :), allocatable , intent (inout ) :: to
55- type (err_t), intent (inout ), optional :: err
55+ type (err_t), intent (out ), optional :: err
56+ character (len=* ), intent (in ), optional :: errmsg
5657
5758 select type (from)
5859 class is (str_value_t)
5960 to = from % value
6061 return
6162 end select
6263
63- call seterr( err, " expected string but got: " // from % to_str() )
64+ if (present (errmsg)) then
65+ call seterr( err, errmsg )
66+ else
67+ call seterr( err, " expected string but got: " // from % to_str() )
68+ end if
6469end subroutine
6570
6671end module
You can’t perform that action at this time.
0 commit comments