functionfence_lengthpureprivate
pure integer function fence_length(line)
The length of the code fence that line starts with, or 0.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| line | character(len=*) | in | the line |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| fence_length | integer |
Source
Show the code
pure integer function fence_length(line)
character(len=*), intent(in) :: line !! the line
character :: c
fence_length = 0
if (len(line) < 3) return
c = line(1:1)
if (c /= '`' .and. c /= '~') return
fence_length = verify(line//' ', c) - 1
if (fence_length < 3) fence_length = 0
end function fence_length