fdoc

subroutinesetext_headerrecursiveprivate

recursive subroutine setext_header(t, parent, block, stack, n)

The underlined header processor.

Arguments

NameTypeIntentAttributesDescription
ttype(tree_t)inout

the conversion

parentintegerin

the node

blockcharacter(len=*)in

the chunk

stacktype(string_t)inoutallocatabledimension(:)

the chunks left

nintegerinout

how many there are

Calls

Source

Show the code
recursive subroutine setext_header(t, parent, block, stack, n)
    type(tree_t), intent(inout) :: t                        !! the conversion
    integer, intent(in) :: parent                           !! the node
    character(len=*), intent(in) :: block                   !! the chunk
    type(string_t), allocatable, intent(inout) :: stack(:)  !! the chunks left
    integer, intent(inout) :: n                             !! how many there are
    integer :: a, b, node

    a = index(block, NL)
    b = index(block(a + 1:), NL)
    call new_node(t, parent, merge('h1', 'h2', block(a + 1:a + 1) == '='), node)
    t%nodes(node)%text = strip(block(:a - 1))
    if (b > 0) call push_back(stack, n, block(a + b + 1:))
end subroutine setext_header

Graphs

Calls

Called by