subroutinefypp_sourceprivate
subroutine fypp_source(s, path, text)
Replace text by the output of Fypp for path, or keep it if that fails.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| s | type(settings_t) | in | the settings | |
| path | character(len=*) | in | the file | |
| text | character(len=:) | inout | allocatable | 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