Skip to content

Commit

Permalink
Revert parse_comp_set algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Feb 27, 2024
1 parent 6e70881 commit f4b1f6e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/version_f.f90
Original file line number Diff line number Diff line change
Expand Up @@ -922,26 +922,36 @@ subroutine parse_comp_set(this, string, error)
end if

allocate (this%comps(0))

do
if (str(1:1) == '>') then
if (str(2:2) == '=') then
if (len(str) == 0) then
call comp%parse_comp_and_crop_str('', str, error)
else if (str(1:1) == '>') then
if (len(str) == 1) then
call comp%parse_comp_and_crop_str('>', str, error)
else if (str(2:2) == '=') then
call comp%parse_comp_and_crop_str('>=', str, error)
else
call comp%parse_comp_and_crop_str('>', str, error)
end if
else if (str(1:1) == '<') then
if (str(2:2) == '=') then
if (len(str) == 1) then
call comp%parse_comp_and_crop_str('<', str, error)
else if (str(2:2) == '=') then
call comp%parse_comp_and_crop_str('<=', str, error)
else
call comp%parse_comp_and_crop_str('<', str, error)
end if
else if (str(1:1) == '=') then
call comp%parse_comp_and_crop_str('=', str, error)
else if (len(str) == 1) then
call comp%parse_comp_and_crop_str('', str, error)
else if (str(1:2) == '!=') then
call comp%parse_comp_and_crop_str('!=', str, error)
else
call comp%parse_comp_and_crop_str('', str, error)
end if

if (allocated(error)) return
call this%extend_with(comp)
if (str == '') return
Expand Down

0 comments on commit f4b1f6e

Please sign in to comment.