getTag works now for tags with the same start and close tag
needed for '/echo/'. Still suggest to rather use /echo\
This commit is contained in:
parent
52088691d1
commit
037ab3d081
|
@ -833,16 +833,16 @@ pure function IO_getTag(string,openChar,closeChar)
|
||||||
character(len=*), intent(in) :: string !< string to check for tag
|
character(len=*), intent(in) :: string !< string to check for tag
|
||||||
character(len=len_trim(string)) :: IO_getTag
|
character(len=len_trim(string)) :: IO_getTag
|
||||||
|
|
||||||
character(len=*), intent(in) :: openChar, & !< indicates beginning of tag
|
character, intent(in) :: openChar, & !< indicates beginning of tag
|
||||||
closeChar !< indicates end of tag
|
closeChar !< indicates end of tag
|
||||||
|
|
||||||
character(len=*), parameter :: SEP=achar(32)//achar(9)//achar(10)//achar(13) ! whitespaces
|
character(len=*), parameter :: SEP=achar(32)//achar(9)//achar(10)//achar(13) ! whitespaces
|
||||||
|
|
||||||
integer :: left,right ! no pInt
|
integer :: left,right ! no pInt
|
||||||
|
|
||||||
IO_getTag = ''
|
IO_getTag = ''
|
||||||
left = scan(string,openChar)
|
left = scan(string,openChar)
|
||||||
right = scan(string,closeChar)
|
right = merge(scan(string,closeChar), scan(string(left:),closeChar),openChar /= closeChar)
|
||||||
|
|
||||||
if (left == verify(string,SEP) .and. right > left) & ! openChar is first and closeChar occurs
|
if (left == verify(string,SEP) .and. right > left) & ! openChar is first and closeChar occurs
|
||||||
IO_getTag = string(left+1:right-1)
|
IO_getTag = string(left+1:right-1)
|
||||||
|
|
Loading…
Reference in New Issue