Kind of the line i:lend from its first non-blank token.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(token_list_t), | intent(in) | :: | tokens |
the token list |
||
| integer, | intent(in) | :: | i |
first and last token of the line |
||
| integer, | intent(in) | :: | lend |
first and last token of the line |
pure integer function line_kind(tokens, i, lend) result(kind) !! Kind of the line `i:lend` from its first non-blank token. type(token_list_t), intent(in) :: tokens !! the token list integer, intent(in) :: i, lend !! first and last token of the line integer :: k kind = SK_BLANK do k = i, lend select case (tokens%tok(k)%kind) case (TK_SPACE, TK_NEWLINE, TK_BOM) cycle case (TK_COMMENT) kind = SK_COMMENT case (TK_PREPROC) kind = SK_PREPROC case default kind = SK_CODE end select return end do end function line_kind