diff --git a/src/version_f.f90 b/src/version_f.f90 index 606727b..b12d489 100644 --- a/src/version_f.f90 +++ b/src/version_f.f90 @@ -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. @@ -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 @@ -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 @@ -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`.