comment signs depend on file format, so better implement specific
variants if needed instead of relying on central functionality
This commit is contained in:
Martin Diehl 2024-02-04 06:53:41 +01:00 committed by achalhp
parent 4f60ded80d
commit 5dbe3f109c
1 changed files with 0 additions and 23 deletions

View File

@ -25,15 +25,12 @@ implicit none(type,external)
IO_QUOTES = "'"//'"' IO_QUOTES = "'"//'"'
character, parameter, public :: & character, parameter, public :: &
IO_EOL = LF !< end of line character IO_EOL = LF !< end of line character
character, parameter :: &
IO_COMMENT = '#'
public :: & public :: &
IO_init, & IO_init, &
IO_selfTest, & IO_selfTest, &
IO_read, & IO_read, &
IO_readlines, & IO_readlines, &
IO_isBlank, &
IO_wrapLines, & IO_wrapLines, &
IO_strPos, & IO_strPos, &
IO_strValue, & IO_strValue, &
@ -149,22 +146,6 @@ function IO_read(fileName) result(fileContent)
end function IO_read end function IO_read
!--------------------------------------------------------------------------------------------------
!> @brief Identifiy strings without content.
!--------------------------------------------------------------------------------------------------
logical pure function IO_isBlank(str)
character(len=*), intent(in) :: str !< string to check for content
integer :: posNonBlank
posNonBlank = verify(str,IO_WHITESPACE)
IO_isBlank = posNonBlank == 0 .or. posNonBlank == scan(str,IO_COMMENT)
end function IO_isBlank
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Insert EOL at separator trying to keep line length below limit. !> @brief Insert EOL at separator trying to keep line length below limit.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -845,10 +826,6 @@ subroutine IO_selfTest()
'A'//LF//'B'//LF) error stop 'CRLF2LF/4' 'A'//LF//'B'//LF) error stop 'CRLF2LF/4'
if (CRLF2LF('A'//LF//CR//'B') /= 'A'//LF//CR//'B') error stop 'CRLF2LF/5' if (CRLF2LF('A'//LF//CR//'B') /= 'A'//LF//CR//'B') error stop 'CRLF2LF/5'
str=' '; if (.not. IO_isBlank(str)) error stop 'IO_isBlank/1'
str=' #isBlank';if (.not. IO_isBlank(str)) error stop 'IO_isBlank/2'
str=' i#s'; if ( IO_isBlank(str)) error stop 'IO_isBlank/3'
str='*(HiU!)3';if ('*(hiu!)3' /= IO_lc(str)) error stop 'IO_lc' str='*(HiU!)3';if ('*(hiu!)3' /= IO_lc(str)) error stop 'IO_lc'
if ('abc, def' /= IO_wrapLines('abc, def')) & if ('abc, def' /= IO_wrapLines('abc, def')) &