How good a place the end of a token with this text is for a line break (1 is best).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
lowercase text of the token |
||
| integer, | intent(in) | :: | kind |
token kind ( |
pure integer function priority(text, kind) result(prio) !! How good a place the end of a token with this text is for a line break (1 is best). character(len=*), intent(in) :: text !! lowercase text of the token integer, intent(in) :: kind !! token kind (`TK_*`) prio = 4 select case (kind) case (TK_OP) select case (text) case (',') prio = 1 case ('(', '[') prio = 3 case (')', ']', '%', ':') prio = 4 case default prio = 2 end select case (TK_DOTOP) if (text /= '.true.' .and. text /= '.false.' .and. text /= '.not.') prio = 2 end select end function priority