@@ -107,47 +107,47 @@ module stdlib_ascii
107
107
contains
108
108
109
109
!> Checks whether `c` is an ASCII letter (A .. Z, a .. z).
110
- pure logical function is_alpha(c)
110
+ elemental logical function is_alpha(c)
111
111
character(len=1), intent(in) :: c !! The character to test.
112
112
is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z')
113
113
end function
114
114
115
115
!> Checks whether `c` is a letter or a number (0 .. 9, a .. z, A .. Z).
116
- pure logical function is_alphanum(c)
116
+ elemental logical function is_alphanum(c)
117
117
character(len=1), intent(in) :: c !! The character to test.
118
118
is_alphanum = (c >= '0' .and. c <= '9') .or. (c >= 'a' .and. c <= 'z') &
119
119
.or. (c >= 'A' .and. c <= 'Z')
120
120
end function
121
121
122
122
!> Checks whether or not `c` is in the ASCII character set -
123
123
!> i.e. in the range 0 .. 0x7F.
124
- pure logical function is_ascii(c)
124
+ elemental logical function is_ascii(c)
125
125
character(len=1), intent(in) :: c !! The character to test.
126
126
is_ascii = iachar(c) <= int(z'7F')
127
127
end function
128
128
129
129
!> Checks whether `c` is a control character.
130
- pure logical function is_control(c)
130
+ elemental logical function is_control(c)
131
131
character(len=1), intent(in) :: c !! The character to test.
132
132
integer :: ic
133
133
ic = iachar(c)
134
134
is_control = ic < int(z'20') .or. ic == int(z'7F')
135
135
end function
136
136
137
137
!> Checks whether `c` is a digit (0 .. 9).
138
- pure logical function is_digit(c)
138
+ elemental logical function is_digit(c)
139
139
character(len=1), intent(in) :: c !! The character to test.
140
140
is_digit = ('0' <= c) .and. (c <= '9')
141
141
end function
142
142
143
143
!> Checks whether `c` is a digit in base 8 (0 .. 7).
144
- pure logical function is_octal_digit(c)
144
+ elemental logical function is_octal_digit(c)
145
145
character(len=1), intent(in) :: c !! The character to test.
146
146
is_octal_digit = (c >= '0') .and. (c <= '7');
147
147
end function
148
148
149
149
!> Checks whether `c` is a digit in base 16 (0 .. 9, A .. F, a .. f).
150
- pure logical function is_hex_digit(c)
150
+ elemental logical function is_hex_digit(c)
151
151
character(len=1), intent(in) :: c !! The character to test.
152
152
is_hex_digit = (c >= '0' .and. c <= '9') .or. (c >= 'a' .and. c <= 'f') &
153
153
.or. (c >= 'A' .and. c <= 'F')
@@ -156,7 +156,7 @@ contains
156
156
!> Checks whether or not `c` is a punctuation character. That includes
157
157
!> all ASCII characters which are not control characters, letters,
158
158
!> digits, or whitespace.
159
- pure logical function is_punctuation(c)
159
+ elemental logical function is_punctuation(c)
160
160
character(len=1), intent(in) :: c !! The character to test.
161
161
integer :: ic
162
162
ic = iachar(c) ! '~' '!'
@@ -166,7 +166,7 @@ contains
166
166
167
167
!> Checks whether or not `c` is a printable character other than the
168
168
!> space character.
169
- pure logical function is_graphical(c)
169
+ elemental logical function is_graphical(c)
170
170
character(len=1), intent(in) :: c !! The character to test.
171
171
integer :: ic
172
172
ic = iachar(c)
@@ -177,7 +177,7 @@ contains
177
177
178
178
!> Checks whether or not `c` is a printable character - including the
179
179
!> space character.
180
- pure logical function is_printable(c)
180
+ elemental logical function is_printable(c)
181
181
character(len=1), intent(in) :: c !! The character to test.
182
182
integer :: ic
183
183
ic = iachar(c)
@@ -186,23 +186,23 @@ contains
186
186
end function
187
187
188
188
!> Checks whether `c` is a lowercase ASCII letter (a .. z).
189
- pure logical function is_lower(c)
189
+ elemental logical function is_lower(c)
190
190
character(len=1), intent(in) :: c !! The character to test.
191
191
integer :: ic
192
192
ic = iachar(c)
193
193
is_lower = ic >= iachar('a') .and. ic <= iachar('z')
194
194
end function
195
195
196
196
!> Checks whether `c` is an uppercase ASCII letter (A .. Z).
197
- pure logical function is_upper(c)
197
+ elemental logical function is_upper(c)
198
198
character(len=1), intent(in) :: c !! The character to test.
199
199
is_upper = (c >= 'A') .and. (c <= 'Z')
200
200
end function
201
201
202
202
!> Checks whether or not `c` is a whitespace character. That includes the
203
203
!> space, tab, vertical tab, form feed, carriage return, and linefeed
204
204
!> characters.
205
- pure logical function is_white(c)
205
+ elemental logical function is_white(c)
206
206
character(len=1), intent(in) :: c !! The character to test.
207
207
integer :: ic
208
208
ic = iachar(c) ! TAB, LF, VT, FF, CR
@@ -211,7 +211,7 @@ contains
211
211
212
212
!> Checks whether or not `c` is a blank character. That includes the
213
213
!> only the space and tab characters
214
- pure logical function is_blank(c)
214
+ elemental logical function is_blank(c)
215
215
character(len=1), intent(in) :: c !! The character to test.
216
216
integer :: ic
217
217
ic = iachar(c) ! TAB
0 commit comments