1 /* 2 ** $Id: lctype.c $ 3 ** 'ctype' functions for Lua 4 ** See Copyright Notice in lua.h 5 */ 6 7 #define lctype_c 8 #define LUA_CORE 9 10 #include "lprefix.h" 11 12 13 #include "lctype.h" 14 15 #if !LUA_USE_CTYPE /* { */ 16 17 #include <limits.h> 18 19 20 #if defined (LUA_UCID) /* accept UniCode IDentifiers? */ 21 /* consider all non-ascii codepoints to be alphabetic */ 22 #define NONA 0x01 23 #else 24 #define NONA 0x00 /* default */ 25 #endif 26 27 28 LUAI_DDEF const lu_byte luai_ctype_[UCHAR_MAX + 2] = { 29 0x00, /* EOZ */ 30 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0. */ 31 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 32 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1. */ 33 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* 2. */ 35 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 36 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, /* 3. */ 37 0x16, 0x16, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 38 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 4. */ 39 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 40 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 5. */ 41 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x05, 42 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 6. */ 43 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 44 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 7. */ 45 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, 46 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* 8. */ 47 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 48 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* 9. */ 49 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 50 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* a. */ 51 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 52 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* b. */ 53 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 54 0x00, 0x00, NONA, NONA, NONA, NONA, NONA, NONA, /* c. */ 55 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 56 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* d. */ 57 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 58 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, /* e. */ 59 NONA, NONA, NONA, NONA, NONA, NONA, NONA, NONA, 60 NONA, NONA, NONA, NONA, NONA, 0x00, 0x00, 0x00, /* f. */ 61 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 62 }; 63 64 #endif /* } */ 65