diff options
Diffstat (limited to 'libraries/luajit-2.0/src/lj_char.c')
-rw-r--r-- | libraries/luajit-2.0/src/lj_char.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libraries/luajit-2.0/src/lj_char.c b/libraries/luajit-2.0/src/lj_char.c new file mode 100644 index 0000000..11f23ef --- /dev/null +++ b/libraries/luajit-2.0/src/lj_char.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | ** Character types. | ||
3 | ** Donated to the public domain. | ||
4 | ** | ||
5 | ** This is intended to replace the problematic libc single-byte NLS functions. | ||
6 | ** These just don't make sense anymore with UTF-8 locales becoming the norm | ||
7 | ** on POSIX systems. It never worked too well on Windows systems since hardly | ||
8 | ** anyone bothered to call setlocale(). | ||
9 | ** | ||
10 | ** This table is hardcoded for ASCII. Identifiers include the characters | ||
11 | ** 128-255, too. This allows for the use of all non-ASCII chars as identifiers | ||
12 | ** in the lexer. This is a broad definition, but works well in practice | ||
13 | ** for both UTF-8 locales and most single-byte locales (such as ISO-8859-*). | ||
14 | ** | ||
15 | ** If you really need proper character types for UTF-8 strings, please use | ||
16 | ** an add-on library such as slnunicode: http://luaforge.net/projects/sln/ | ||
17 | */ | ||
18 | |||
19 | #define lj_char_c | ||
20 | #define LUA_CORE | ||
21 | |||
22 | #include "lj_char.h" | ||
23 | |||
24 | LJ_DATADEF const uint8_t lj_char_bits[257] = { | ||
25 | 0, | ||
26 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, | ||
27 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
28 | 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
29 | 152,152,152,152,152,152,152,152,152,152, 4, 4, 4, 4, 4, 4, | ||
30 | 4,176,176,176,176,176,176,160,160,160,160,160,160,160,160,160, | ||
31 | 160,160,160,160,160,160,160,160,160,160,160, 4, 4, 4, 4,132, | ||
32 | 4,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192, | ||
33 | 192,192,192,192,192,192,192,192,192,192,192, 4, 4, 4, 4, 1, | ||
34 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
35 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
36 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
37 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
38 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
39 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
40 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, | ||
41 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 | ||
42 | }; | ||
43 | |||