Debian Codegraph @

libs/lua53/TLpatches/patch-01-utf-8

raw
1 diff -u lctype.h.orig lctype.h
2 --- lctype.h.orig 2020-10-04 12:05:56.139893521 +0200
3 +++ lctype.h 2020-10-04 12:21:33.348948021 +0200
4 @@ -7,6 +7,8 @@
5 #ifndef lctype_h
6 #define lctype_h
7
8 +#include <ctype.h>
9 +
10 #include "lua.h"
11
12
13 @@ -53,9 +55,11 @@
14
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))
27