Skip to content

Commit 7d9a4f6

Browse files
authored
Merge branch 'master' into Duplicate_module_definitions
2 parents d7850f0 + 799fcac commit 7d9a4f6

File tree

7 files changed

+157
-132
lines changed

7 files changed

+157
-132
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ Its key goal is to improve the user experience of Fortran programmers.
55
It does so by making it easier to build your Fortran program or library, run the
66
executables, tests, and examples, and distribute it as a dependency to other
77
Fortran projects.
8-
Fpm's user interface is modeled after [Rust's Cargo](https://crates.io/),
8+
Fpm's user interface is modeled after [Rust's Cargo](https://doc.rust-lang.org/cargo/),
99
so if you're familiar with that tool, you will feel at home with fpm.
1010
Fpm's long term vision is to nurture and grow the ecosystem of modern Fortran
1111
applications and libraries.
1212

1313
Fpm is an early prototype and is evolving rapidly.
1414
You can use it to build and package your Fortran projects, as well as to use
15-
existing fpm packages as dependencies.
15+
[existing fpm packages](https://github.com/fortran-lang/fpm-registry) as dependencies.
1616
Fpm's behavior and user interface may change as it evolves, however as fpm
1717
matures and we enter production, we will aim to stay backwards compatible.
1818
Please follow the [issues](https://github.com/fortran-lang/fpm/issues) to
1919
contribute and/or stay up to date with the development.
2020
Before opening a bug report or a feature suggestion, please read our
21-
[Contributor Guide](CONTRIBUTING.md).
21+
[Contributor Guide](CONTRIBUTING.md). You can also discuss your ideas and queries with the community in [fpm discussions](https://github.com/fortran-lang/fpm/discussions), or more broadly on [Fortran-Lang Discourse](https://fortran-lang.discourse.group/)
2222

2323
Fortran Package Manager is not to be confused with
2424
[Jordan Sissel's fpm](https://github.com/jordansissel/fpm), a more general,

fpm/fpm.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "fpm"
2-
version = "0.1.4"
2+
version = "0.2.0"
33
license = "MIT"
44
author = "fpm maintainers"
55
maintainer = ""

fpm/src/fpm_command_line.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ subroutine get_command_line_settings(cmd_settings)
133133
case default ; os_type = "OS Type: UNKNOWN"
134134
end select
135135
version_text = [character(len=80) :: &
136-
& 'Version: 0.1.4, alpha', &
136+
& 'Version: 0.2.0, alpha', &
137137
& 'Program: fpm(1)', &
138138
& 'Description: A Fortran package manager and build system', &
139139
& 'Home Page: https://github.com/fortran-lang/fpm', &

fpm/src/fpm_source_parsing.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ module fpm_source_parsing
3333
'iso_fortran_env', &
3434
'ieee_arithmetic', &
3535
'ieee_exceptions', &
36-
'ieee_features ']
36+
'ieee_features ', &
37+
'omp_lib ']
3738

3839
contains
3940

fpm/src/fpm_strings.f90

Lines changed: 55 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,13 @@ end subroutine resize_string
431431

432432
!>AUTHOR: John S. Urban
433433
!!LICENSE: Public Domain
434-
!!## NAME
435-
!! join(3f) - [fpm_strings:EDITING] append CHARACTER variable array into
434+
!>
435+
!!##NAME
436+
!! join(3f) - [M_strings:EDITING] append CHARACTER variable array into
436437
!! a single CHARACTER variable with specified separator
437438
!! (LICENSE:PD)
438439
!!
439-
!!## SYNOPSIS
440+
!!##SYNOPSIS
440441
!!
441442
!! pure function join(str,sep,trm,left,right,start,end) result (string)
442443
!!
@@ -449,13 +450,13 @@ end subroutine resize_string
449450
!! character(len=*),intent(in),optional :: end
450451
!! character(len=:),allocatable :: string
451452
!!
452-
!!## DESCRIPTION
453+
!!##DESCRIPTION
453454
!! JOIN(3f) appends the elements of a CHARACTER array into a single
454455
!! CHARACTER variable, with elements 1 to N joined from left to right.
455456
!! By default each element is trimmed of trailing spaces and the
456457
!! default separator is a null string.
457458
!!
458-
!!## OPTIONS
459+
!!##OPTIONS
459460
!! STR(:) array of CHARACTER variables to be joined
460461
!! SEP separator string to place between each variable. defaults
461462
!! to a null string.
@@ -466,81 +467,75 @@ end subroutine resize_string
466467
!! TRM option to trim each element of STR of trailing
467468
!! spaces. Defaults to .TRUE.
468469
!!
469-
!!## RESULT
470+
!!##RESULT
470471
!! STRING CHARACTER variable composed of all of the elements of STR()
471472
!! appended together with the optional separator SEP placed
472473
!! between the elements.
473474
!!
474-
!!## EXAMPLE
475+
!!##EXAMPLE
475476
!!
476477
!! Sample program:
477-
!!```fortran
478-
!! program demo_join
479-
!! use fpm_strings, only: join
480-
!! implicit none
481-
!! character(len=:),allocatable :: s(:)
482-
!! character(len=:),allocatable :: out
483-
!! integer :: i
484-
!! s=[character(len=10) :: 'United',' we',' stand,', &
485-
!! & ' divided',' we fall.']
486-
!! out=join(s)
487-
!! write(*,'(a)') out
488-
!! write(*,'(a)') join(s,trm=.false.)
489-
!! write(*,'(a)') (join(s,trm=.false.,sep='|'),i=1,3)
490-
!! write(*,'(a)') join(s,sep='<>')
491-
!! write(*,'(a)') join(s,sep=';',left='[',right=']')
492-
!! write(*,'(a)') join(s,left='[',right=']')
493-
!! write(*,'(a)') join(s,left='>>')
494-
!! end program demo_join
495-
!!```fortran
496478
!!
497-
!! Expected output:
479+
!! program demo_join
480+
!! use M_strings, only: join
481+
!! implicit none
482+
!! character(len=:),allocatable :: s(:)
483+
!! character(len=:),allocatable :: out
484+
!! integer :: i
485+
!! s=[character(len=10) :: 'United',' we',' stand,', &
486+
!! & ' divided',' we fall.']
487+
!! out=join(s)
488+
!! write(*,'(a)') out
489+
!! write(*,'(a)') join(s,trm=.false.)
490+
!! write(*,'(a)') (join(s,trm=.false.,sep='|'),i=1,3)
491+
!! write(*,'(a)') join(s,sep='<>')
492+
!! write(*,'(a)') join(s,sep=';',left='[',right=']')
493+
!! write(*,'(a)') join(s,left='[',right=']')
494+
!! write(*,'(a)') join(s,left='>>')
495+
!! end program demo_join
498496
!!
499-
!! United we stand, divided we fall.
500-
!! United we stand, divided we fall.
501-
!! United | we | stand, | divided | we fall.
502-
!! United | we | stand, | divided | we fall.
503-
!! United | we | stand, | divided | we fall.
504-
!! United<> we<> stand,<> divided<> we fall.
505-
!! [United];[ we];[ stand,];[ divided];[ we fall.]
506-
!! [United][ we][ stand,][ divided][ we fall.]
507-
!! >>United>> we>> stand,>> divided>> we fall.
497+
!! Expected output:
508498
!!
499+
!! United we stand, divided we fall.
500+
!! United we stand, divided we fall.
501+
!! United | we | stand, | divided | we fall.
502+
!! United | we | stand, | divided | we fall.
503+
!! United | we | stand, | divided | we fall.
504+
!! United<> we<> stand,<> divided<> we fall.
505+
!! [United];[ we];[ stand,];[ divided];[ we fall.]
506+
!! [United][ we][ stand,][ divided][ we fall.]
507+
!! >>United>> we>> stand,>> divided>> we fall.
509508
pure function join(str,sep,trm,left,right,start,end) result (string)
510509

511-
! @(#)join(3f): append an array of character variables with specified separator into a single CHARACTER variable
510+
! @(#)M_strings::join(3f): merge string array into a single CHARACTER value adding specified separators, caps, prefix and suffix
512511

513512
character(len=*),intent(in) :: str(:)
514-
character(len=*),intent(in),optional :: sep
515-
character(len=*),intent(in),optional :: right
516-
character(len=*),intent(in),optional :: left
517-
character(len=*),intent(in),optional :: start
518-
character(len=*),intent(in),optional :: end
513+
character(len=*),intent(in),optional :: sep, right, left, start, end
519514
logical,intent(in),optional :: trm
515+
character(len=:),allocatable :: sep_local, left_local, right_local
520516
character(len=:),allocatable :: string
521-
integer :: i
522517
logical :: trm_local
523-
character(len=:),allocatable :: sep_local
524-
character(len=:),allocatable :: left_local
525-
character(len=:),allocatable :: right_local
526-
527-
if(present(sep))then ; sep_local=sep ; else ; sep_local='' ; endif
528-
if(present(trm))then ; trm_local=trm ; else ; trm_local=.true. ; endif
529-
if(present(left))then ; left_local=left ; else ; left_local='' ; endif
530-
if(present(right))then ; right_local=right ; else ; right_local='' ; endif
531-
518+
integer :: i
519+
if(present(sep))then ; sep_local=sep ; else ; sep_local='' ; endif
520+
if(present(trm))then ; trm_local=trm ; else ; trm_local=.true. ; endif
521+
if(present(left))then ; left_local=left ; else ; left_local='' ; endif
522+
if(present(right))then ; right_local=right ; else ; right_local='' ; endif
532523
string=''
533-
do i = 1,size(str)-1
524+
if(size(str).eq.0)then
525+
string=string//left_local//right_local
526+
else
527+
do i = 1,size(str)-1
528+
if(trm_local)then
529+
string=string//left_local//trim(str(i))//right_local//sep_local
530+
else
531+
string=string//left_local//str(i)//right_local//sep_local
532+
endif
533+
enddo
534534
if(trm_local)then
535-
string=string//left_local//trim(str(i))//right_local//sep_local
535+
string=string//left_local//trim(str(i))//right_local
536536
else
537-
string=string//left_local//str(i)//right_local//sep_local
537+
string=string//left_local//str(i)//right_local
538538
endif
539-
enddo
540-
if(trm_local)then
541-
string=string//left_local//trim(str(i))//right_local
542-
else
543-
string=string//left_local//str(i)//right_local
544539
endif
545540
if(present(start))string=start//string
546541
if(present(end))string=string//end

0 commit comments

Comments
 (0)