Skip to content

Commit 0f0a191

Browse files
committed
Update: parsing to allow program after module
If a program is found at the end of a source file, it will override any previous definition of unit_type to FPM_UNIT_PROGRAM.
1 parent 02ffa06 commit 0f0a191

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fpm/src/fpm_sources.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ function parse_f_source(f_filename,error) result(f_source)
378378

379379
end if
380380

381-
! Detect if is program
382-
if (f_source%unit_type == FPM_UNIT_UNKNOWN .and. &
383-
index(adjustl(lower(file_lines(i)%s)),'program') == 1) then
381+
! Detect if contains a program
382+
! (no modules allowed after program def)
383+
if (index(adjustl(lower(file_lines(i)%s)),'program') == 1) then
384384

385385
f_source%unit_type = FPM_UNIT_PROGRAM
386386

0 commit comments

Comments
 (0)