2 // Copyright (c) 2003 by Digital Mars
4 // written by Walter Bright
5 // http://www.digitalmars.com
6 // License for redistribution is by either the Artistic License
7 // in artistic.txt, or the GNU General Public License in gnu.txt.
8 // See the included readme.txt for details.
12 /*******************************
13 * Return !=0 if unicode alpha.
14 * Use table from C99 Appendix D.
17 int isUniAlpha(unsigned u
)
19 static unsigned short table
[][2] =
190 // { 0x0E50, 0x0E59 },
273 for (int i
= 0; i
< sizeof(table
) / sizeof(table
[0]); i
++)
275 //printf("%x\n", table[i][0]);
276 assert(table
[i
][0] <= table
[i
][1]);
277 if (i
< sizeof(table
) / sizeof(table
[0]) - 1)
278 assert(table
[i
][1] < table
[i
+ 1][0]);
291 high
= sizeof(table
) / sizeof(table
[0]) - 1;
294 mid
= (low
+ high
) >> 1;
295 if (u
< table
[mid
][0])
297 else if (u
> table
[mid
][1])
305 for (int i
= 0; i
< sizeof(table
) / sizeof(table
[0]); i
++)
307 assert(u
< table
[i
][0] || u
> table
[i
][1]);
314 for (int i
= 0; i
< sizeof(table
) / sizeof(table
[0]); i
++)
316 if (u
>= table
[i
][0] && u
<= table
[i
][1])
319 assert(0); // should have been in table