Skip to content

Commit

Permalink
Print errors
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Mar 10, 2024
1 parent 0b138c0 commit 3960241
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions src/version_f.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module version_f

contains

procedure :: to_string, try_satisfy, satisfies_comp_set, satisfies_comp
procedure :: try_satisfy, satisfies_comp_set, satisfies_comp

generic :: create => try_create
procedure, private :: try_create
Expand Down Expand Up @@ -222,35 +222,6 @@ subroutine try_create(this, major, minor, patch, prerelease, build, error, stric
end if
end

!> Returns a string representation of the version including prerelease and
!> build data.
pure function to_string(this) result(str)
class(version_t), intent(in) :: this
character(:), allocatable :: str

integer :: i

str = trim(int2s(this%major))//'.' &
& //trim(int2s(this%minor))//'.' &
& //trim(int2s(this%patch))

if (allocated(this%prerelease)) then
str = str//'-'
do i = 1, size(this%prerelease)
str = str//this%prerelease(i)%str
if (i < size(this%prerelease)) str = str//'.'
end do
end if

if (allocated(this%build)) then
str = str//'+'
do i = 1, size(this%build)
str = str//this%build(i)%str
if (i < size(this%build)) str = str//'.'
end do
end if
end

!> Parse a string into a version including prerelease and build data.
!>
!> Wrapper function for `try_parse`.
Expand Down Expand Up @@ -701,10 +672,12 @@ subroutine try_satisfy(this, string, is_satisfied, error)
end if

call version_range%parse(str, error)
print *, 'parse error ', allocated(error)
if (allocated(error)) return

do i = 1, size(version_range%comp_sets)
call this%satisfies_comp_set(version_range%comp_sets(i), is_satisfied, error)
print *, 'satisfy error ', error%msg
if (is_satisfied .or. allocated(error)) return
end do
end
Expand Down

0 comments on commit 3960241

Please sign in to comment.