面行の pos 以降にある次の空白区切りトークンの範囲を返す。
計数パスと解析パスが同じ規則でトークンを数えるための共通 tokenizer。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | s |
|
||
| integer, | intent(inout) | :: | pos |
走査開始位置。戻り値はトークン直後の位置。 |
||
| integer, | intent(out) | :: | first |
トークン先頭位置。トークンがなければ |
||
| integer, | intent(out) | :: | last |
トークン先頭位置。トークンがなければ |
pure subroutine next_face_token(s, pos, first, last) character(len=*), intent(in) :: s integer, intent(inout) :: pos integer, intent(out) :: first, last integer :: n n = len_trim(s) do while (pos <= n) if (s(pos:pos) /= ' ') exit pos = pos + 1 end do first = pos last = pos - 1 do while (pos <= n) if (s(pos:pos) == ' ') exit last = pos pos = pos + 1 end do end subroutine next_face_token