A preprocessor line: a fypp directive (#:, #!, $:, @:) is indented by ind; a cpp line
is written as it is. Continuation lines of the directive are not changed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(writer_t), | intent(inout) | :: | w |
the output and the alignment state |
||
| character(len=*), | intent(in) | :: | src |
the source text |
||
| type(token_list_t), | intent(in) | :: | tokens |
its tokens |
||
| type(statement_t), | intent(in) | :: | s |
the line, a preprocessor item |
||
| integer, | intent(in) | :: | ind |
indentation, in blanks |
subroutine emit_fypp_line(w, src, tokens, s, ind) !! A preprocessor line: a fypp directive (`#:`, `#!`, `$:`, `@:`) is indented by `ind`; a cpp line !! is written as it is. Continuation lines of the directive are not changed. type(writer_t), intent(inout) :: w !! the output and the alignment state character(len=*), intent(in) :: src !! the source text type(token_list_t), intent(in) :: tokens !! its tokens type(statement_t), intent(in) :: s !! the line, a preprocessor item integer, intent(in) :: ind !! indentation, in blanks integer :: f f = first_non_blank(tokens, s%first, s%last) if (f > s%last) then call emit_range(w, src, tokens, s%first, s%last) return end if associate (t => tokens%tok(f)) if (t%kind /= TK_PREPROC .or. t%last == t%first) then call emit_range(w, src, tokens, s%first, s%last) else if (src(t%first:t%first) == '#' .and. index(':!', src(t%first + 1:t%first + 1)) == 0) then call emit_range(w, src, tokens, s%first, s%last) ! cpp else call put(w, repeat(' ', ind)) call emit_range(w, src, tokens, f, s%last) end if end associate end subroutine emit_fypp_line