fdoc

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

NameTypeIntentAttributesDescription
ttype(tree_t)in

the conversion

parentintegerin

the node

blockcharacter(len=*)in

the chunk

levelintegerout

the list depth

nodeintegerout

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

Graphs

Calls

Called by