Skip to content

Commit d64229b

Browse files
committed
Print unit_type as a string
1 parent 39818aa commit d64229b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

fpm/src/fpm_model.f90

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,25 @@ function info_srcfile(source) result(s)
309309
end do
310310
s = s // "]"
311311
! integer :: unit_type = FPM_UNIT_UNKNOWN
312-
s = s // ", unit_type=" // str(source%unit_type)
312+
s = s // ", unit_type="
313+
select case(source%unit_type)
314+
case (FPM_UNIT_UNKNOWN)
315+
s = s // "FPM_UNIT_UNKNOWN"
316+
case (FPM_UNIT_PROGRAM)
317+
s = s // "FPM_UNIT_PROGRAM"
318+
case (FPM_UNIT_MODULE)
319+
s = s // "FPM_UNIT_MODULE"
320+
case (FPM_UNIT_SUBMODULE)
321+
s = s // "FPM_UNIT_SUBMODULE"
322+
case (FPM_UNIT_SUBPROGRAM)
323+
s = s // "FPM_UNIT_SUBPROGRAM"
324+
case (FPM_UNIT_CSOURCE)
325+
s = s // "FPM_UNIT_CSOURCE"
326+
case (FPM_UNIT_CHEADER)
327+
s = s // "FPM_UNIT_CHEADER"
328+
case default
329+
s = s // "INVALID"
330+
end select
313331
! type(string_t), allocatable :: modules_used(:)
314332
s = s // ", modules_used=["
315333
do i = 1, size(source%modules_used)

0 commit comments

Comments
 (0)