subroutineload_source
subroutine load_source(s, path, raw, text, stat, errmsg)
Read source file path, preprocessing it if its extension calls for that. Unless that runs an
external command, this can be called from parallel code.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| s | type(settings_t) | in | the settings | |
| path | character(len=*) | in | the file | |
| raw | character(len=:) | out | allocatable | the file as it is |
| text | character(len=:) | out | allocatable | the text to parse |
| stat | integer | out | nonzero on failure | |
| errmsg | character(len=:) | out | allocatable | what is wrong |
Calls
Source
Show the code
subroutine load_source(s, path, raw, text, stat, errmsg)
type(settings_t), intent(in) :: s !! the settings
character(len=*), intent(in) :: path !! the file
character(len=:), allocatable, intent(out) :: raw !! the file as it is
character(len=:), allocatable, intent(out) :: text !! the text to parse
integer, intent(out) :: stat !! nonzero on failure
character(len=:), allocatable, intent(out) :: errmsg !! what is wrong
call read_whole_file(path, raw, stat, errmsg)
if (stat /= 0) return
text = raw
if (needs_fypp(s, path)) then
call fypp_source(s, path, text)
else if (s%preprocess .and. contains_string(s%fpp_extensions, extension_of(path))) then
call preprocess(s, path, text)
end if
end subroutine load_source