Skip to content

Commit

Permalink
Remove unused variables and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fluidnumerics-joe committed Jun 16, 2024
1 parent fc1022a commit 0d52c86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 61 deletions.
20 changes: 2 additions & 18 deletions src/FEQParse.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module FEQParse
procedure :: Print_InFixTokens
procedure :: Print_PostFixTokens

procedure,private :: Priority
procedure,nopass,private :: Priority

endtype EquationParser

Expand Down Expand Up @@ -1664,23 +1664,7 @@ logical function IsFunction(varlen,eqChar,idx)
enddo
endfunction

function ToLowerCase(str) result(res)
character(*),intent(in) :: str
character(len(str)),allocatable :: res
integer :: i

do i = 1,len(str)
select case(str(i:i))
case('A':'Z')
res(i:i) = achar(iachar(str(i:i))+32)
case default
res(i:i) = str(i:i)
endselect
enddo
endfunction ToLowerCase

integer function Priority(parser,toke)
class(EquationParser) :: parser
integer function Priority(toke)
type(Token) :: toke

if(toke%tokenType == Function_Token) then
Expand Down
44 changes: 1 addition & 43 deletions src/FEQParse_Functions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ pure real(real64) function f64(x)
contains
procedure,private,pass(lhs) :: character_array_assign_function
procedure,private,pass(lhs) :: character_assign_function
procedure,private,pass(rhs) :: function_assign_character
generic :: assignment(=) => character_assign_function,character_array_assign_function
procedure,private,pass(lhs) :: function_eq_character
procedure,private,pass(rhs) :: character_eq_function
Expand Down Expand Up @@ -107,7 +106,6 @@ pure real(real64) function randomize_r64()
interface AddFunction
module procedure :: AddFunction32
module procedure :: AddFunction64
module procedure :: AddFunction32And64
endinterface

interface Tuple
Expand Down Expand Up @@ -158,12 +156,6 @@ subroutine character_assign_function(lhs,rhs)
maxFunctionLength = max(maxFunctionLength,lhs%len)
endsubroutine

pure subroutine function_assign_character(lhs,rhs)
character(len=*),allocatable,intent(inout) :: lhs
class(FEQParse_Function),intent(in) :: rhs
lhs = rhs%str
endsubroutine

elemental function function_eq_character(lhs,rhs) result(ok)
class(FEQParse_Function),intent(in) :: lhs !! Left hand side.
character(len=*),intent(in) :: rhs !! Right hand side.
Expand Down Expand Up @@ -306,25 +298,6 @@ subroutine AddFunction64(name,f_64)
endif
endsubroutine

subroutine AddFunction32And64(name,f_32,f_64)
character(*),intent(in) :: name
procedure(f32) :: f_32
procedure(f64) :: f_64
!private
type(FEQParse_Function) :: func

call InitializeFunctions()
func = name
func%ptr32 => f_32
func%ptr64 => f_64
if(nFunctions < maxFunctions) then
Functions(nFunctions+1) = func
nFunctions = nFunctions+1
else
stop 'Argument out of range'
endif
endsubroutine

elemental real(real32) function invoke32(this,x) result(fx)
class(FEQParse_Function),intent(in) :: this
real(real32),intent(in) :: x
Expand Down Expand Up @@ -508,7 +481,7 @@ pure real(real64) function rand64(x) result(fx)
pure function ToUpperCase(str) result(res)
character(*),intent(in) :: str
character(len(str)) :: res
integer :: i,j
integer :: i

do i = 1,len(str)
select case(str(i:i))
Expand All @@ -520,21 +493,6 @@ pure function ToUpperCase(str) result(res)
enddo
endfunction ToUpperCase

pure function ToLowerCase(str) result(res)
character(*),intent(in) :: str
character(len(str)),allocatable :: res
integer :: i

do i = 1,len(str)
select case(str(i:i))
case('A':'Z')
res(i:i) = achar(iachar(str(i:i))+32)
case default
res(i:i) = str(i:i)
endselect
enddo
endfunction ToLowerCase

endmodule FEQParse_Functions

real(real32) function randomize_r32()
Expand Down

0 comments on commit 0d52c86

Please sign in to comment.