subroutineevaluate_argsrecursiveprivate
recursive subroutine evaluate_args(c, id, positional, num_positional, keywords, by_keyword)
Evaluate the arguments of call id.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| id | integer | in | the call | |
| positional | type(value_t) | out | allocatabledimension(:) | the positional arguments |
| num_positional | integer | out | how many there are | |
| keywords | integer | out | allocatabledimension(:) | the keywords |
| by_keyword | type(value_t) | out | allocatabledimension(:) | 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