fdoc

subroutineparse_subscriptrecursiveprivate

recursive subroutine parse_subscript(c, s, object, id)

A subscript of object, or a slice.

Arguments

NameTypeIntentAttributesDescription
ctype(fypp_t)inout

the state

stype(scan_t)inout

the expression

objectintegerin

what is subscripted

idintegerout

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

Graphs

Calls

Called by