functiontruth_ofpureprivate
pure logical function truth_of(v) result(truth)
The truth of v.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| v | type(value_t) | in | the value |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| truth | logical |
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