Parse option data from a source string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(option), | intent(inout) | :: | self | Option data. |
||
character, | intent(in) | :: | sep | Separator of option name/value. |
||
type(string), | intent(inout) | :: | source | String containing option data. |
||
integer(kind=I4P), | intent(out) | :: | error | Error code. |
elemental subroutine parse(self, sep, source, error)
!< Parse option data from a source string.
class(option), intent(inout) :: self !< Option data.
character(*), intent(in) :: sep !< Separator of option name/value.
type(string), intent(inout) :: source !< String containing option data.
integer(I4P), intent(out) :: error !< Error code.
error = ERR_OPTION
if (scan(adjustl(source), comments) == 1) return
call self%parse_name(sep=sep, source=source, error=error)
call self%parse_value(sep=sep, source=source, error=error)
call self%parse_comment
endsubroutine parse