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 77bca62

Browse files
changed naming convention throughout the module
1 parent 17b047d commit 77bca62

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
@@ -687,13 +688,13 @@ pure subroutine insert_before_stringlist_int_impl( list, idxn, slist )
687688
list%stringarray(idxnew) = slist%stringarray(i)
688689
end do
689690

690-
end subroutine insert_before_stringlist_int_impl
691+
end subroutine insert_before_stringlist_int
691692

692693
!> Version: experimental
693694
!>
694695
!> Inserts chararray 'carray' BEFORE integer index 'idxn' in the underlying stringarray
695696
!> Modifies the input stringlist 'list'
696-
pure subroutine insert_before_chararray_int_impl( list, idxn, carray )
697+
pure subroutine insert_before_chararray_int( list, idxn, carray )
697698
!> Not a part of public API
698699
class(stringlist_type), intent(inout) :: list
699700
integer, intent(in) :: idxn
@@ -710,13 +711,13 @@ pure subroutine insert_before_chararray_int_impl( list, idxn, carray )
710711
list%stringarray(idxnew) = string_type( carray(i) )
711712
end do
712713

713-
end subroutine insert_before_chararray_int_impl
714+
end subroutine insert_before_chararray_int
714715

715716
!> Version: experimental
716717
!>
717718
!> Inserts stringarray 'sarray' BEFORE integer index 'idxn' in the underlying stringarray
718719
!> Modifies the input stringlist 'list'
719-
pure subroutine insert_before_stringarray_int_impl( list, idxn, sarray )
720+
pure subroutine insert_before_stringarray_int( list, idxn, sarray )
720721
!> Not a part of public API
721722
class(stringlist_type), intent(inout) :: list
722723
integer, intent(in) :: idxn
@@ -733,7 +734,7 @@ pure subroutine insert_before_stringarray_int_impl( list, idxn, sarray )
733734
list%stringarray(idxnew) = sarray(i)
734735
end do
735736

736-
end subroutine insert_before_stringarray_int_impl
737+
end subroutine insert_before_stringarray_int
737738

738739
! get:
739740

@@ -773,35 +774,35 @@ end subroutine get_engine
773774
!>
774775
!> Returns the string present at stringlist_index 'idx' in stringlist 'list'
775776
!> Returns string_type instance
776-
pure function get_idx_impl( list, idx )
777+
pure function get_idx( list, idx )
777778
class(stringlist_type), intent(in) :: list
778779
type(stringlist_index_type), intent(in) :: idx
779780

780-
type(string_type) :: get_idx_impl
781+
type(string_type) :: get_idx
781782
type(string_type), allocatable :: capture_strings(:)
782783

783784
call get_engine( list, idx, idx, capture_strings )
784785

785786
! if index 'idx' is out of bounds, returns an empty string
786787
if ( size(capture_strings) == 1 ) then
787-
call move( capture_strings(1), get_idx_impl )
788+
call move( capture_strings(1), get_idx )
788789
end if
789790

790-
end function get_idx_impl
791+
end function get_idx
791792

792793
!> Version: experimental
793794
!>
794795
!> Returns strings present at stringlist_indexes in interval ['first', 'last']
795796
!> Returns array of string_type instances
796-
pure function get_range_idx_impl( list, first, last )
797+
pure function get_range_idx( list, first, last )
797798
class(stringlist_type), intent(in) :: list
798799
type(stringlist_index_type), intent(in) :: first, last
799800

800-
type(string_type), allocatable :: get_range_idx_impl(:)
801+
type(string_type), allocatable :: get_range_idx(:)
801802

802-
call get_engine( list, first, last, get_range_idx_impl )
803+
call get_engine( list, first, last, get_range_idx )
803804

804-
end function get_range_idx_impl
805+
end function get_range_idx
805806

806807
! pop & drop:
807808

@@ -860,59 +861,59 @@ end subroutine pop_drop_engine
860861
!>
861862
!> Removes the string present at stringlist_index 'idx' in stringlist 'list'
862863
!> Returns the removed string
863-
function pop_idx_impl( list, idx )
864+
function pop_idx( list, idx )
864865
class(stringlist_type), intent(inout) :: list
865866
type(stringlist_index_type), intent(in) :: idx
866-
type(string_type) :: pop_idx_impl
867+
type(string_type) :: pop_idx
867868

868869
type(string_type), dimension(:), allocatable :: popped_strings
869870

870871
call pop_drop_engine( list, idx, idx, popped_strings )
871872

872873
if ( size(popped_strings) == 1 ) then
873-
call move( pop_idx_impl, popped_strings(1) )
874+
call move( pop_idx, popped_strings(1) )
874875
end if
875876

876-
end function pop_idx_impl
877+
end function pop_idx
877878

878879
!> Version: experimental
879880
!>
880881
!> Removes strings present at stringlist_indexes in interval ['first', 'last']
881882
!> in stringlist 'list'
882883
!> Returns removed strings
883-
function pop_range_idx_impl( list, first, last )
884+
function pop_range_idx( list, first, last )
884885
class(stringlist_type), intent(inout) :: list
885886
type(stringlist_index_type), intent(in) :: first, last
886887

887-
type(string_type), dimension(:), allocatable :: pop_range_idx_impl
888+
type(string_type), dimension(:), allocatable :: pop_range_idx
888889

889-
call pop_drop_engine( list, first, last, pop_range_idx_impl )
890+
call pop_drop_engine( list, first, last, pop_range_idx )
890891

891-
end function pop_range_idx_impl
892+
end function pop_range_idx
892893

893894
!> Version: experimental
894895
!>
895896
!> Removes the string present at stringlist_index 'idx' in stringlist 'list'
896897
!> Doesn't return the removed string
897-
pure subroutine drop_idx_impl( list, idx )
898+
pure subroutine drop_idx( list, idx )
898899
class(stringlist_type), intent(inout) :: list
899900
type(stringlist_index_type), intent(in) :: idx
900901

901902
call pop_drop_engine( list, idx, idx )
902903

903-
end subroutine drop_idx_impl
904+
end subroutine drop_idx
904905

905906
!> Version: experimental
906907
!>
907908
!> Removes strings present at stringlist_indexes in interval ['first', 'last']
908909
!> in stringlist 'list'
909910
!> Doesn't return removed strings
910-
pure subroutine drop_range_idx_impl( list, first, last )
911+
pure subroutine drop_range_idx( list, first, last )
911912
class(stringlist_type), intent(inout) :: list
912913
type(stringlist_index_type), intent(in) :: first, last
913914

914915
call pop_drop_engine( list, first, last )
915916

916-
end subroutine drop_range_idx_impl
917+
end subroutine drop_range_idx
917918

918919
end module stdlib_stringlist_type

0 commit comments

Comments
(0)

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