Skip to content

Commit

Permalink
Change type declaration order
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Feb 26, 2024
1 parent 944c240 commit ef39426
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/version_f.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ module version_f
public :: version_t, string_t, error_t, is_version, version_range_t, &
comparator_set_t, comparator_t, operator_index

type :: string_t
character(:), allocatable :: str
contains
generic :: num => string_t_2i
procedure, private :: string_t_2i
generic :: is_numeric => string_t_is_numeric
procedure, private :: string_t_is_numeric
end type

interface string_t
module procedure :: create_string_t
end interface

!> Contains all version information.
type :: version_t
!> The major version number. Incremented when breaking changes are made.
Expand Down Expand Up @@ -57,19 +70,6 @@ module version_f
module procedure create, parse
end interface

type :: string_t
character(:), allocatable :: str
contains
generic :: num => string_t_2i
procedure, private :: string_t_2i
generic :: is_numeric => string_t_is_numeric
procedure, private :: string_t_is_numeric
end type

interface string_t
module procedure :: create_string_t
end interface

type :: error_t
character(:), allocatable :: msg
end type
Expand All @@ -78,13 +78,17 @@ module version_f
module procedure :: create_error_t
end interface

type :: version_range_t
type(comparator_set_t), allocatable :: comp_sets(:)
type :: comparator_t
character(:), allocatable :: op
type(version_t) :: version
contains
generic :: parse => parse_version_range
procedure :: parse_version_range
procedure, private :: parse_comp_and_crop_str
end type

interface comparator_t
module procedure :: create_comp
end interface

type :: comparator_set_t
type(comparator_t), allocatable :: comps(:)
contains
Expand All @@ -96,17 +100,13 @@ module version_f
module procedure :: create_comp_set
end interface

type :: comparator_t
character(:), allocatable :: op
type(version_t) :: version
type :: version_range_t
type(comparator_set_t), allocatable :: comp_sets(:)
contains
procedure, private :: parse_comp_and_crop_str
generic :: parse => parse_version_range
procedure :: parse_version_range
end type

interface comparator_t
module procedure :: create_comp
end interface

contains

!> Wrapper function for `try_create`.
Expand Down

0 comments on commit ef39426

Please sign in to comment.