Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e34cce2

Browse files
changed naming convention throughout the module
1 parent e935ea1 commit e34cce2

File tree

1 file changed

+63
-62
lines changed

1 file changed

+63
-62
lines changed

‎src/stdlib_stringlist_type.f90‎

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -60,41 +60,42 @@ module stdlib_stringlist_type
6060

6161
procedure, public :: len => length_list
6262

63-
procedure :: to_future_at_idxn=> convert_to_future_at_idxn
63+
procedure :: to_future_at_idxn
6464

65-
procedure :: to_current_idxn=> convert_to_current_idxn
65+
procedure :: to_current_idxn
6666

67-
procedure :: insert_at_char_idx=> insert_at_char_idx_wrap
68-
procedure :: insert_at_string_idx=> insert_at_string_idx_wrap
69-
procedure :: insert_at_stringlist_idx=> insert_at_stringlist_idx_wrap
70-
procedure :: insert_at_chararray_idx=> insert_at_chararray_idx_wrap
71-
procedure :: insert_at_stringarray_idx=> insert_at_stringarray_idx_wrap
67+
procedure :: insert_at_char_idx
68+
procedure :: insert_at_string_idx
69+
procedure :: insert_at_stringlist_idx
70+
procedure :: insert_at_chararray_idx
71+
procedure :: insert_at_stringarray_idx
7272
generic, public :: insert_at => insert_at_char_idx, &
7373
insert_at_string_idx, &
7474
insert_at_stringlist_idx, &
7575
insert_at_chararray_idx, &
7676
insert_at_stringarray_idx
7777

78-
procedure :: insert_before_string_int=> insert_before_string_int_impl
79-
procedure :: insert_before_stringlist_int=> insert_before_stringlist_int_impl
80-
procedure :: insert_before_chararray_int=> insert_before_chararray_int_impl
81-
procedure :: insert_before_stringarray_int=> insert_before_stringarray_int_impl
78+
procedure :: insert_before_string_int
79+
procedure :: insert_before_stringlist_int
80+
procedure :: insert_before_chararray_int
81+
procedure :: insert_before_stringarray_int
8282
generic :: insert_before => insert_before_string_int, &
8383
insert_before_stringlist_int, &
8484
insert_before_chararray_int, &
8585
insert_before_stringarray_int
8686

87-
procedure :: get_idx=> get_idx_impl
88-
procedure :: get_range_idx=> get_range_idx_impl
87+
procedure :: get_idx
88+
procedure :: get_range_idx
8989
generic, public :: get => get_idx, &
9090
get_range_idx
9191

92-
procedure :: pop_index ! or `pop_idx`, if you wish
93-
procedure :: pop_range_index ! or `pop_range_idx`, if you wish
94-
generic, public :: pop => pop_index, pop_range_index
92+
procedure :: pop_idx
93+
procedure :: pop_range_idx
94+
generic, public :: pop => pop_idx, &
95+
pop_range_idx
9596

96-
procedure :: drop_idx=> drop_idx_impl
97-
procedure :: drop_range_idx=> drop_range_idx_impl
97+
procedure :: drop_idx
98+
procedure :: drop_range_idx
9899
generic, public :: drop => drop_idx, &
99100
drop_range_idx
100101

@@ -510,98 +511,98 @@ end function length_list
510511
!> Converts a forward index OR a backward index to an integer index at
511512
!> which the new element will be present post insertion (i.e. in future)
512513
!> Returns an integer
513-
pure integer function convert_to_future_at_idxn( list, idx )
514+
pure integer function to_future_at_idxn( list, idx )
514515
!> Not a part of public API
515516
class(stringlist_type), intent(in) :: list
516517
type(stringlist_index_type), intent(in) :: idx
517518

518519
! Formula: merge( fidx( x ) - ( list_head - 1 ), len - bidx( x ) + ( list_tail - 1 ) + 2, ... )
519-
convert_to_future_at_idxn = merge( idx%offset, list%len() - idx%offset + 2 , idx%forward )
520+
to_future_at_idxn = merge( idx%offset, list%len() - idx%offset + 2 , idx%forward )
520521

521-
end function convert_to_future_at_idxn
522+
end function to_future_at_idxn
522523

523524
! to_current_idxn:
524525

525526
!> Version: experimental
526527
!>
527528
!> Converts a forward index OR backward index to its equivalent integer index idxn
528529
!> Returns an integer
529-
pure integer function convert_to_current_idxn( list, idx )
530+
pure integer function to_current_idxn( list, idx )
530531
!> Not a part of public API
531532
class(stringlist_type), intent(in) :: list
532533
type(stringlist_index_type), intent(in) :: idx
533534

534535
! Formula: merge( fidx( x ) - ( list_head - 1 ), len + 1 - bidx( x ) + ( list_tail - 1 ), ... )
535-
convert_to_current_idxn = merge( idx%offset, list%len() - idx%offset + 1, idx%forward )
536+
to_current_idxn = merge( idx%offset, list%len() - idx%offset + 1, idx%forward )
536537

537-
end function convert_to_current_idxn
538+
end function to_current_idxn
538539

539540
! insert_at:
540541

541542
!> Version: experimental
542543
!>
543544
!> Inserts character scalar 'string' AT stringlist_index 'idx' in stringlist 'list'
544545
!> Modifies the input stringlist 'list'
545-
pure subroutine insert_at_char_idx_wrap( list, idx, string )
546+
pure subroutine insert_at_char_idx( list, idx, string )
546547
class(stringlist_type), intent(inout) :: list
547548
type(stringlist_index_type), intent(in) :: idx
548549
character(len=*), intent(in) :: string
549550

550551
call list%insert_at( idx, string_type( string ) )
551552

552-
end subroutine insert_at_char_idx_wrap
553+
end subroutine insert_at_char_idx
553554

554555
!> Version: experimental
555556
!>
556557
!> Inserts string 'string' AT stringlist_index 'idx' in stringlist 'list'
557558
!> Modifies the input stringlist 'list'
558-
pure subroutine insert_at_string_idx_wrap( list, idx, string )
559+
pure subroutine insert_at_string_idx( list, idx, string )
559560
class(stringlist_type), intent(inout) :: list
560561
type(stringlist_index_type), intent(in) :: idx
561562
type(string_type), intent(in) :: string
562563

563564
call list%insert_before( list%to_future_at_idxn( idx ), string )
564565

565-
end subroutine insert_at_string_idx_wrap
566+
end subroutine insert_at_string_idx
566567

567568
!> Version: experimental
568569
!>
569570
!> Inserts stringlist 'slist' AT stringlist_index 'idx' in stringlist 'list'
570571
!> Modifies the input stringlist 'list'
571-
pure subroutine insert_at_stringlist_idx_wrap( list, idx, slist )
572+
pure subroutine insert_at_stringlist_idx( list, idx, slist )
572573
class(stringlist_type), intent(inout) :: list
573574
type(stringlist_index_type), intent(in) :: idx
574575
type(stringlist_type), intent(in) :: slist
575576

576577
call list%insert_before( list%to_future_at_idxn( idx ), slist )
577578

578-
end subroutine insert_at_stringlist_idx_wrap
579+
end subroutine insert_at_stringlist_idx
579580

580581
!> Version: experimental
581582
!>
582583
!> Inserts chararray 'carray' AT stringlist_index 'idx' in stringlist 'list'
583584
!> Modifies the input stringlist 'list'
584-
pure subroutine insert_at_chararray_idx_wrap( list, idx, carray )
585+
pure subroutine insert_at_chararray_idx( list, idx, carray )
585586
class(stringlist_type), intent(inout) :: list
586587
type(stringlist_index_type), intent(in) :: idx
587588
character(len=*), dimension(:), intent(in) :: carray
588589

589590
call list%insert_before( list%to_future_at_idxn( idx ), carray )
590591

591-
end subroutine insert_at_chararray_idx_wrap
592+
end subroutine insert_at_chararray_idx
592593

593594
!> Version: experimental
594595
!>
595596
!> Inserts stringarray 'sarray' AT stringlist_index 'idx' in stringlist 'list'
596597
!> Modifies the input stringlist 'list'
597-
pure subroutine insert_at_stringarray_idx_wrap( list, idx, sarray )
598+
pure subroutine insert_at_stringarray_idx( list, idx, sarray )
598599
class(stringlist_type), intent(inout) :: list
599600
type(stringlist_index_type), intent(in) :: idx
600601
type(string_type), dimension(:), intent(in) :: sarray
601602

602603
call list%insert_before( list%to_future_at_idxn( idx ), sarray )
603604

604-
end subroutine insert_at_stringarray_idx_wrap
605+
end subroutine insert_at_stringarray_idx
605606

606607
!> Version: experimental
607608
!>
@@ -643,7 +644,7 @@ end subroutine insert_before_engine
643644
!>
644645
!> Inserts string 'string' BEFORE integer index 'idxn' in the underlying stringarray
645646
!> Modifies the input stringlist 'list'
646-
pure subroutine insert_before_string_int_impl( list, idxn, string )
647+
pure subroutine insert_before_string_int( list, idxn, string )
647648
!> Not a part of public API
648649
class(stringlist_type), intent(inout) :: list
649650
integer, intent(in) :: idxn
@@ -656,13 +657,13 @@ pure subroutine insert_before_string_int_impl( list, idxn, string )
656657

657658
list%stringarray(work_idxn) = string
658659

659-
end subroutine insert_before_string_int_impl
660+
end subroutine insert_before_string_int
660661

661662
!> Version: experimental
662663
!>
663664
!> Inserts stringlist 'slist' BEFORE integer index 'idxn' in the underlying stringarray
664665
!> Modifies the input stringlist 'list'
665-
pure subroutine insert_before_stringlist_int_impl( list, idxn, slist )
666+
pure subroutine insert_before_stringlist_int( list, idxn, slist )
666667
!> Not a part of public API
667668
class(stringlist_type), intent(inout) :: list
668669
integer, intent(in) :: idxn
@@ -691,13 +692,13 @@ pure subroutine insert_before_stringlist_int_impl( list, idxn, slist )
691692
end do
692693
end if
693694

694-
end subroutine insert_before_stringlist_int_impl
695+
end subroutine insert_before_stringlist_int
695696

696697
!> Version: experimental
697698
!>
698699
!> Inserts chararray 'carray' BEFORE integer index 'idxn' in the underlying stringarray
699700
!> Modifies the input stringlist 'list'
700-
pure subroutine insert_before_chararray_int_impl( list, idxn, carray )
701+
pure subroutine insert_before_chararray_int( list, idxn, carray )
701702
!> Not a part of public API
702703
class(stringlist_type), intent(inout) :: list
703704
integer, intent(in) :: idxn
@@ -714,13 +715,13 @@ pure subroutine insert_before_chararray_int_impl( list, idxn, carray )
714715
list%stringarray(idxnew) = string_type( carray(i) )
715716
end do
716717

717-
end subroutine insert_before_chararray_int_impl
718+
end subroutine insert_before_chararray_int
718719

719720
!> Version: experimental
720721
!>
721722
!> Inserts stringarray 'sarray' BEFORE integer index 'idxn' in the underlying stringarray
722723
!> Modifies the input stringlist 'list'
723-
pure subroutine insert_before_stringarray_int_impl( list, idxn, sarray )
724+
pure subroutine insert_before_stringarray_int( list, idxn, sarray )
724725
!> Not a part of public API
725726
class(stringlist_type), intent(inout) :: list
726727
integer, intent(in) :: idxn
@@ -737,7 +738,7 @@ pure subroutine insert_before_stringarray_int_impl( list, idxn, sarray )
737738
list%stringarray(idxnew) = sarray(i)
738739
end do
739740

740-
end subroutine insert_before_stringarray_int_impl
741+
end subroutine insert_before_stringarray_int
741742

742743
! get:
743744

@@ -777,35 +778,35 @@ end subroutine get_engine
777778
!>
778779
!> Returns the string present at stringlist_index 'idx' in stringlist 'list'
779780
!> Returns string_type instance
780-
pure function get_idx_impl( list, idx )
781+
pure function get_idx( list, idx )
781782
class(stringlist_type), intent(in) :: list
782783
type(stringlist_index_type), intent(in) :: idx
783784

784-
type(string_type) :: get_idx_impl
785+
type(string_type) :: get_idx
785786
type(string_type), allocatable :: capture_strings(:)
786787

787788
call get_engine( list, idx, idx, capture_strings )
788789

789790
! if index 'idx' is out of bounds, returns an empty string
790791
if ( size(capture_strings) == 1 ) then
791-
call move( capture_strings(1), get_idx_impl )
792+
call move( capture_strings(1), get_idx )
792793
end if
793794

794-
end function get_idx_impl
795+
end function get_idx
795796

796797
!> Version: experimental
797798
!>
798799
!> Returns strings present at stringlist_indexes in interval ['first', 'last']
799800
!> Returns array of string_type instances
800-
pure function get_range_idx_impl( list, first, last )
801+
pure function get_range_idx( list, first, last )
801802
class(stringlist_type), intent(in) :: list
802803
type(stringlist_index_type), intent(in) :: first, last
803804

804-
type(string_type), allocatable :: get_range_idx_impl(:)
805+
type(string_type), allocatable :: get_range_idx(:)
805806

806-
call get_engine( list, first, last, get_range_idx_impl )
807+
call get_engine( list, first, last, get_range_idx )
807808

808-
end function get_range_idx_impl
809+
end function get_range_idx
809810

810811
! pop & drop:
811812

@@ -864,59 +865,59 @@ end subroutine pop_drop_engine
864865
!>
865866
!> Removes the string present at stringlist_index 'idx' in stringlist 'list'
866867
!> Returns the removed string
867-
function pop_idx_impl( list, idx )
868+
function pop_idx( list, idx )
868869
class(stringlist_type), intent(inout) :: list
869870
type(stringlist_index_type), intent(in) :: idx
870-
type(string_type) :: pop_idx_impl
871+
type(string_type) :: pop_idx
871872

872873
type(string_type), dimension(:), allocatable :: popped_strings
873874

874875
call pop_drop_engine( list, idx, idx, popped_strings )
875876

876877
if ( size(popped_strings) == 1 ) then
877-
call move( pop_idx_impl, popped_strings(1) )
878+
call move( pop_idx, popped_strings(1) )
878879
end if
879880

880-
end function pop_idx_impl
881+
end function pop_idx
881882

882883
!> Version: experimental
883884
!>
884885
!> Removes strings present at stringlist_indexes in interval ['first', 'last']
885886
!> in stringlist 'list'
886887
!> Returns removed strings
887-
function pop_range_idx_impl( list, first, last )
888+
function pop_range_idx( list, first, last )
888889
class(stringlist_type), intent(inout) :: list
889890
type(stringlist_index_type), intent(in) :: first, last
890891

891-
type(string_type), dimension(:), allocatable :: pop_range_idx_impl
892+
type(string_type), dimension(:), allocatable :: pop_range_idx
892893

893-
call pop_drop_engine( list, first, last, pop_range_idx_impl )
894+
call pop_drop_engine( list, first, last, pop_range_idx )
894895

895-
end function pop_range_idx_impl
896+
end function pop_range_idx
896897

897898
!> Version: experimental
898899
!>
899900
!> Removes the string present at stringlist_index 'idx' in stringlist 'list'
900901
!> Doesn't return the removed string
901-
pure subroutine drop_idx_impl( list, idx )
902+
pure subroutine drop_idx( list, idx )
902903
class(stringlist_type), intent(inout) :: list
903904
type(stringlist_index_type), intent(in) :: idx
904905

905906
call pop_drop_engine( list, idx, idx )
906907

907-
end subroutine drop_idx_impl
908+
end subroutine drop_idx
908909

909910
!> Version: experimental
910911
!>
911912
!> Removes strings present at stringlist_indexes in interval ['first', 'last']
912913
!> in stringlist 'list'
913914
!> Doesn't return removed strings
914-
pure subroutine drop_range_idx_impl( list, first, last )
915+
pure subroutine drop_range_idx( list, first, last )
915916
class(stringlist_type), intent(inout) :: list
916917
type(stringlist_index_type), intent(in) :: first, last
917918

918919
call pop_drop_engine( list, first, last )
919920

920-
end subroutine drop_range_idx_impl
921+
end subroutine drop_range_idx
921922

922923
end module stdlib_stringlist_type

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /