True if token t is a < or > operator directly next to another one, as in the CUDA
kernel launch call k<<<grid, block>>>(x), where they are not relational operators.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | src |
the source the tokens were read from |
||
| type(token_list_t), | intent(in) | :: | tokens |
tokens of |
||
| integer, | intent(in) | :: | t |
index into |
pure logical function is_chevron(src, tokens, t) !! True if token `t` is a `<` or `>` operator directly next to another one, as in the CUDA !! kernel launch `call k<<<grid, block>>>(x)`, where they are not relational operators. character(len=*), intent(in) :: src !! the source the tokens were read from type(token_list_t), intent(in) :: tokens !! tokens of `src` integer, intent(in) :: t !! index into `tokens` is_chevron = .false. if (.not. is_angle(t)) return if (t > 1) is_chevron = is_angle(t - 1) if (t < tokens%n) is_chevron = is_chevron .or. is_angle(t + 1) contains pure logical function is_angle(k) !! True if token `k` is a `<` or `>` operator. integer, intent(in) :: k !! index into `tokens` is_angle = .false. if (tokens%tok(k)%kind /= TK_OP) return is_angle = src(tokens%tok(k)%first:tokens%tok(k)%last) == '<' .or. & src(tokens%tok(k)%first:tokens%tok(k)%last) == '>' end function is_angle end function is_chevron