functionlast_childpureprivate
pure integer function last_child(t, parent)
The last child of node parent, or 0.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| t | type(tree_t) | in | the conversion | |
| parent | integer | in | the node |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| last_child | integer |
Source
Show the code
pure integer function last_child(t, parent)
type(tree_t), intent(in) :: t !! the conversion
integer, intent(in) :: parent !! the node
last_child = 0
if (size(t%nodes(parent)%kids) > 0) last_child = t%nodes(parent)%kids(size(t%nodes(parent)%kids))
end function last_child