beta-0.89.2
[luatex.git] / source / libs / lua52 / lua52-PATCHES / patch-01-utf-8
blob9ad9749410600bf91b357a34ec8415ce1f14b4ac
1 diff -ur lua-5.2.4.orig/src/lctype.h lua-5.2.4/src/lctype.h
2 --- lua-5.2.4.orig/src/lctype.h 2013-04-12 20:48:47.000000000 +0200
3 +++ lua-5.2.4/src/lctype.h      2014-02-13 13:17:33.000000000 +0100
4 @@ -7,6 +7,8 @@
5  #ifndef lctype_h
6  #define lctype_h
7  
8 +#include <ctype.h>
10  #include "lua.h"
13 @@ -53,9 +55,11 @@
15  /*
16  ** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_'
17 +**
18 +** all utf-8 chars (greater than 0x7f) are always alphabetic
19  */
20 -#define lislalpha(c)   testprop(c, MASK(ALPHABIT))
21 -#define lislalnum(c)   testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT)))
22 +#define lislalpha(c)   (isalpha(c) || (c) == '_' || (c) > 0x7f)
23 +#define lislalnum(c)   (isalnum(c) || (c) == '_' || (c) > 0x7f)
24  #define lisdigit(c)    testprop(c, MASK(DIGITBIT))
25  #define lisspace(c)    testprop(c, MASK(SPACEBIT))
26  #define lisprint(c)    testprop(c, MASK(PRINTBIT))