subroutineindent_levelprivate
subroutine indent_level(t, parent, block, level, node)
How deep block is in the lists of parent, and the node at that depth.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| t | type(tree_t) | in | the conversion | |
| parent | integer | in | the node | |
| block | character(len=*) | in | the chunk | |
| level | integer | out | the list depth | |
| node | integer | out | the node at that depth |
Calls
Source
Show the code
subroutine indent_level(t, parent, block, level, node)
type(tree_t), intent(in) :: t !! the conversion
integer, intent(in) :: parent !! the node
character(len=*), intent(in) :: block !! the chunk
integer, intent(out) :: level !! the list depth
integer, intent(out) :: node !! the node at that depth
integer :: indent, child
indent = (verify(block//'x', ' ') - 1)/4
level = merge(1, 0, in_state(t, 'list'))
node = parent
do while (indent > level)
child = last_child(t, node)
if (child == 0) exit
if (is_list(t%nodes(child)%tag)) then
level = level + 1
else if (t%nodes(child)%tag /= 'li') then
exit
end if
node = child
end do
end subroutine indent_level