mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
17 lines
387 B
OpenEdge ABL
17 lines
387 B
OpenEdge ABL
// https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
|
|
|
|
int alpha(char c)
|
|
{
|
|
switch (c)
|
|
{
|
|
case 'A' ... 'Z': return 1;
|
|
case 'a' ... 'z': return 1;
|
|
default: return 0;
|
|
}
|
|
}
|
|
|
|
_Static_assert(alpha('A') == 1, "1");
|
|
_Static_assert(alpha('B') == 1, "2");
|
|
_Static_assert(alpha('z') == 1, "3");
|
|
_Static_assert(alpha('z' + 1) == 0, "3");
|
|
_Static_assert(alpha('0') == 0, "4");
|