fdoc

subroutineevaluate_argsrecursiveprivate

recursive subroutine evaluate_args(c, id, positional, num_positional, keywords, by_keyword)

Evaluate the arguments of call id.

Arguments

NameTypeIntentAttributesDescription
ctype(fypp_t)inout

the state

idintegerin

the call

positionaltype(value_t)outallocatabledimension(:)

the positional arguments

num_positionalintegerout

how many there are

keywordsintegeroutallocatabledimension(:)

the keywords

by_keywordtype(value_t)outallocatabledimension(:)

the arguments given by keyword

Calls

Source

Show the code
recursive subroutine evaluate_args(c, id, positional, num_positional, keywords, by_keyword)
    type(fypp_t), intent(inout) :: c                        !! the state
    integer, intent(in) :: id                               !! the call
    type(value_t), allocatable, intent(out) :: positional(:)    !! the positional arguments
    integer, intent(out) :: num_positional                  !! how many there are
    integer, allocatable, intent(out) :: keywords(:)        !! the keywords
    type(value_t), allocatable, intent(out) :: by_keyword(:)    !! the arguments given by keyword
    integer :: k, n, m

    n = size(c%exprs(id)%args)
    m = count(c%exprs(id)%names > 0)
    allocate (positional(n), keywords(m), by_keyword(m))
    num_positional = 0
    m = 0
    do k = 1, n
        if (c%exprs(id)%names(k) > 0) then
            m = m + 1
            keywords(m) = c%exprs(id)%names(k)
            call evaluate(c, c%exprs(id)%args(k), by_keyword(m))
        else
            num_positional = num_positional + 1
            call evaluate(c, c%exprs(id)%args(k), positional(num_positional))
        end if
    end do
end subroutine evaluate_args

Graphs

Calls

Called by