fdoc

functiontruth_ofpureprivate

pure logical function truth_of(v) result(truth)

The truth of v.

Arguments

NameTypeIntentAttributesDescription
vtype(value_t)in

the value

Result

NameTypeAttributesDescription
truthlogical

Source

Show the code
pure logical function truth_of(v) result(truth)
    type(value_t), intent(in) :: v      !! the value

    select case (v%kind)
    case (V_NONE)
        truth = .false.
    case (V_BOOL, V_INT)
        truth = v%number /= 0
    case (V_STR)
        truth = len(v%text) > 0
    case (V_MACRO)
        truth = .true.
    case default
        truth = size(v%items) > 0
    end select
end function truth_of

Graphs

Called by