Skip to content

Commit d34e902

Browse files
committed
Implement info_srcfile_short()
1 parent ba8ec52 commit d34e902

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

fpm/src/fpm_model.f90

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ recursive function info_build_target(t) result(s)
207207
s = s // 'output_file="' // t%output_file // '"'
208208
! type(srcfile_t), allocatable :: source
209209
if (allocated(t%source)) then
210-
s = s // ", source=" // info_srcfile(t%source)
210+
s = s // ", source=" // info_srcfile_short(t%source)
211211
else
212212
s = s // ", source=()"
213213
end if
@@ -355,6 +355,16 @@ function info_srcfile(source) result(s)
355355
s = s // ")"
356356
end function
357357

358+
function info_srcfile_short(source) result(s)
359+
! Prints a shortened version of srcfile_t
360+
type(srcfile_t), intent(in) :: source
361+
character(:), allocatable :: s
362+
integer :: i
363+
s = "srcfile_t("
364+
s = s // 'file_name="' // source%file_name // '"'
365+
s = s // ", ...)"
366+
end function
367+
358368
function info_model(model) result(s)
359369
type(fpm_model_t), intent(in) :: model
360370
character(:), allocatable :: s

0 commit comments

Comments
 (0)