subroutineparse_subscriptrecursiveprivate
recursive subroutine parse_subscript(c, s, object, id)
A subscript of object, or a slice.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| s | type(scan_t) | inout | the expression | |
| object | integer | in | what is subscripted | |
| id | integer | out | the result |
Calls
Source
Show the code
recursive subroutine parse_subscript(c, s, object, id)
type(fypp_t), intent(inout) :: c !! the state
type(scan_t), intent(inout) :: s !! the expression
integer, intent(in) :: object !! what is subscripted
integer, intent(out) :: id !! the result
integer :: first, last
first = 0
last = 0
if (.not. at_word(s, ':')) call parse_test(c, s, first)
if (at_word(s, ':')) then
call next_token(c, s)
if (.not. at_word(s, ']')) call parse_test(c, s, last)
id = new_expr(c, E_SLICE, object, first, last)
else
id = new_expr(c, E_INDEX, object, first)
end if
end subroutine parse_subscript