functionis_rulepureprivate
pure logical function is_rule(line)
True if line is a horizontal rule.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| line | character(len=*) | in | the line |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| is_rule | logical |
Source
Show the code
pure logical function is_rule(line)
character(len=*), intent(in) :: line !! the line
integer :: first, k, marks
character :: c
is_rule = .false.
first = verify(line, ' ')
if (first == 0 .or. first > 4) return
c = line(first:first)
if (c /= '-' .and. c /= '_' .and. c /= '*') return
marks = 0
do k = first, len(line)
if (line(k:k) == c) then
marks = marks + 1
else if (line(k:k) /= ' ') then
return
end if
end do
is_rule = marks >= 3
end function is_rule