subroutinenormalize_linesprivate
subroutine normalize_lines(lines)
Expand tabs and blank lines of only spaces.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| lines | type(string_t) | inout | dimension(:) | the lines |
Calls
Source
Show the code
subroutine normalize_lines(lines)
type(string_t), intent(inout) :: lines(:) !! the lines
integer :: k, j, column
type(buffer_t) :: b
do k = 1, size(lines)
if (index(lines(k)%s, achar(9)) > 0) then
column = 0
do j = 1, len(lines(k)%s)
if (lines(k)%s(j:j) == achar(9)) then
call add(b, repeat(' ', 4 - mod(column, 4)))
column = column + 4 - mod(column, 4)
else
call add(b, lines(k)%s(j:j))
column = column + 1
end if
end do
call take(b, lines(k)%s)
end if
if (verify(lines(k)%s, ' ') == 0) lines(k)%s = ''
end do
end subroutine normalize_lines