parse_comment Subroutine

private elemental subroutine parse_comment(self)

Parse option inline comment trimming it out from pure value string.

Arguments

TypeIntentOptionalAttributesName
class(option), intent(inout) :: self

Option data.


Contents

Source Code


Source Code

  elemental subroutine parse_comment(self)
  !< Parse option inline comment trimming it out from pure value string.
  class(option), intent(inout) :: self !< Option data.
  integer(I4P)                 :: pos  !< Characters counter.

  if (self%ovals%is_allocated()) then
    pos = self%ovals%index(INLINE_COMMENT)
    if (pos>0) then
      if (pos < self%ovals%len()) self%ocomm = trim(adjustl(self%ovals%slice(pos+1, self%ovals%len())))
      self%ovals = trim(adjustl(self%ovals%slice(1, pos-1)))
    endif
  endif
  endsubroutine parse_comment