subroutinesetext_headerrecursiveprivate
recursive subroutine setext_header(t, parent, block, stack, n)
The underlined header processor.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| t | type(tree_t) | inout | the conversion | |
| parent | integer | in | the node | |
| block | character(len=*) | in | the chunk | |
| stack | type(string_t) | inout | allocatabledimension(:) | the chunks left |
| n | integer | inout | 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