line_kind Function

private pure function line_kind(tokens, i, lend) result(kind)

Kind of the line i:lend from its first non-blank token.

Arguments

Type IntentOptional 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

Return Value integer


Called by

proc~~line_kind~~CalledByGraph proc~line_kind line_kind proc~split_statements split_statements proc~split_statements->proc~line_kind proc~parse_source parse_source proc~parse_source->proc~split_statements proc~code_signature code_signature proc~code_signature->proc~parse_source proc~convert_relational convert_relational proc~convert_relational->proc~parse_source proc~format_pass format_pass proc~format_pass->proc~parse_source proc~limit_diagnostics limit_diagnostics proc~limit_diagnostics->proc~parse_source proc~long_code_lines long_code_lines proc~long_code_lines->proc~parse_source proc~sort_use sort_use proc~sort_use->proc~parse_source proc~split_long_lines split_long_lines proc~split_long_lines->proc~parse_source proc~format_text format_text proc~format_text->proc~convert_relational proc~format_text->proc~format_pass proc~format_text->proc~limit_diagnostics proc~format_text->proc~long_code_lines proc~format_text->proc~sort_use proc~format_text->proc~split_long_lines proc~relayout relayout proc~format_text->proc~relayout proc~relayout->proc~format_pass proc~same_code same_code proc~same_code->proc~code_signature proc~process_text process_text proc~process_text->proc~format_text proc~process_file process_file proc~process_file->proc~process_text proc~process_stdin process_stdin proc~process_stdin->proc~process_text proc~run run proc~run->proc~process_file proc~run->proc~process_stdin

Source Code

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