Skip to content

Commit 5251879

Browse files
committed
Use C style operators
1 parent 407b0f1 commit 5251879

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/stdlib_string_type.f90

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ module stdlib_string_type
1919
public :: len, len_trim, trim, index, scan, verify, repeat, adjustr, adjustl
2020
public :: lgt, lge, llt, lle, char, ichar, iachar
2121
public :: assignment(=)
22-
public :: operator(.gt.), operator(.ge.), operator(.lt.), operator(.le.)
23-
public :: operator(.eq.), operator(.ne.), operator(//)
22+
public :: operator(>), operator(>=), operator(<), operator(<=)
23+
public :: operator(==), operator(/=), operator(//)
2424
public :: write(formatted), write(unformatted)
2525
public :: read(formatted), read(unformatted)
2626

@@ -209,66 +209,66 @@ module stdlib_string_type
209209
!> a string.
210210
!>
211211
!> This operator is elemental and returns a default logical scalar value.
212-
interface operator(.gt.)
212+
interface operator(>)
213213
module procedure :: gt_string_string
214214
module procedure :: gt_string_char
215215
module procedure :: gt_char_string
216-
end interface operator(.gt.)
216+
end interface operator(>)
217217

218218
!> Compare two character sequences for being less, the left-hand side,
219219
!> the right-hand side or both character sequences can be represented by
220220
!> a string.
221221
!>
222222
!> This operator is elemental and returns a default logical scalar value.
223-
interface operator(.lt.)
223+
interface operator(<)
224224
module procedure :: lt_string_string
225225
module procedure :: lt_string_char
226226
module procedure :: lt_char_string
227-
end interface operator(.lt.)
227+
end interface operator(<)
228228

229229
!> Compare two character sequences for being greater than, the left-hand side,
230230
!> the right-hand side or both character sequences can be represented by
231231
!> a string.
232232
!>
233233
!> This operator is elemental and returns a default logical scalar value.
234-
interface operator(.ge.)
234+
interface operator(>=)
235235
module procedure :: ge_string_string
236236
module procedure :: ge_string_char
237237
module procedure :: ge_char_string
238-
end interface operator(.ge.)
238+
end interface operator(>=)
239239

240240
!> Compare two character sequences for being less than, the left-hand side,
241241
!> the right-hand side or both character sequences can be represented by
242242
!> a string.
243243
!>
244244
!> This operator is elemental and returns a default logical scalar value.
245-
interface operator(.le.)
245+
interface operator(<=)
246246
module procedure :: le_string_string
247247
module procedure :: le_string_char
248248
module procedure :: le_char_string
249-
end interface operator(.le.)
249+
end interface operator(<=)
250250

251251
!> Compare two character sequences for equality, the left-hand side,
252252
!> the right-hand side or both character sequences can be represented by
253253
!> a string.
254254
!>
255255
!> This operator is elemental and returns a default logical scalar value.
256-
interface operator(.eq.)
256+
interface operator(==)
257257
module procedure :: eq_string_string
258258
module procedure :: eq_string_char
259259
module procedure :: eq_char_string
260-
end interface operator(.eq.)
260+
end interface operator(==)
261261

262262
!> Compare two character sequences for inequality, the left-hand side,
263263
!> the right-hand side or both character sequences can be represented by
264264
!> a string.
265265
!>
266266
!> This operator is elemental and returns a default logical scalar value.
267-
interface operator(.ne.)
267+
interface operator(/=)
268268
module procedure :: ne_string_string
269269
module procedure :: ne_string_char
270270
module procedure :: ne_char_string
271-
end interface operator(.ne.)
271+
end interface operator(/=)
272272

273273
!> Concatenate two character sequences, the left-hand side, the right-hand side
274274
!> or both character sequences can be represented by a string.

src/tests/string/test_string_derivedtype_io.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module test_string_derivedtype_io
33
use stdlib_error, only : check
44
use stdlib_string_type, only : string_type, assignment(=), len, &
55
write(formatted), read(formatted), write(unformatted), read(unformatted), &
6-
operator(.eq.)
6+
operator(==)
77
implicit none
88

99
contains

src/tests/string/test_string_operator.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
module test_string_operator
33
use stdlib_error, only : check
44
use stdlib_string_type, only : string_type, assignment(=), len, &
5-
operator(.gt.), operator(.lt.), operator(.ge.), operator(.le.), &
6-
operator(.ne.), operator(.eq.), operator(//)
5+
operator(>), operator(<), operator(>=), operator(<=), &
6+
operator(/=), operator(==), operator(//)
77
implicit none
88

99
contains

0 commit comments

Comments
 (0)