True if stmt takes up whole lines on its own, ending with a line break, so that it can
be moved.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(token_list_t), | intent(in) | :: | tokens |
tokens of the source |
||
| type(statement_t), | intent(in) | :: | stmt |
the statement, a range of |
pure logical function whole_lines(tokens, stmt) !! True if `stmt` takes up whole lines on its own, ending with a line break, so that it can !! be moved. type(token_list_t), intent(in) :: tokens !! tokens of the source type(statement_t), intent(in) :: stmt !! the statement, a range of `tokens` whole_lines = .false. if (tokens%tok(stmt%last)%kind /= TK_NEWLINE) return if (stmt%first > 1) then if (tokens%tok(stmt%first - 1)%kind /= TK_NEWLINE) return end if whole_lines = .not. any(tokens%tok(stmt%first:stmt%last)%kind == TK_PREPROC .or. & tokens%tok(stmt%first:stmt%last)%kind == TK_BOM) end function whole_lines