fdoc

subroutinefypp_sourceprivate

subroutine fypp_source(s, path, text)

Replace text by the output of Fypp for path, or keep it if that fails.

Arguments

NameTypeIntentAttributesDescription
stype(settings_t)in

the settings

pathcharacter(len=*)in

the file

textcharacter(len=:)inoutallocatable

the text

Calls

Source

Show the code
subroutine fypp_source(s, path, text)
    type(settings_t), intent(in) :: s                       !! the settings
    character(len=*), intent(in) :: path                    !! the file
    character(len=:), allocatable, intent(inout) :: text    !! the text
    character(len=:), allocatable :: result, errmsg
    integer :: stat

    call fypp_process(path, s%macro, s%include, result, stat, errmsg)
    if (stat == 0) then
        call move_alloc(result, text)
    else
        call warn('preprocessing failed, reverting to the file itself: '//path//': '//errmsg)
    end if
end subroutine fypp_source

Graphs

Calls

Called by