summaryrefslogtreecommitdiff
path: root/Build/source/libs/lua53/TLpatches/patch-01-utf-8
blob: 0f7cb898128dcca3e3189fb7bedead41b8a322c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff -u lctype.h.orig lctype.h 
--- lctype.h.orig	2018-07-21 09:57:36.061692228 +0200
+++ lctype.h	2018-07-21 10:03:29.625677730 +0200
@@ -7,6 +7,8 @@
 #ifndef lctype_h
 #define lctype_h
 
+#include <ctype.h>
+
 #include "lua.h"
 
 
@@ -53,9 +55,11 @@
 
 /*
 ** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_'
+**
+** all utf-8 chars (greater than 0x7f) are always alphabetic
 */
-#define lislalpha(c)	testprop(c, MASK(ALPHABIT))
-#define lislalnum(c)	testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT)))
+#define lislalpha(c)	(isalpha(c) || (c) == '_' || (c) > 0x7f)
+#define lislalnum(c)	(isalnum(c) || (c) == '_' || (c) > 0x7f)
 #define lisdigit(c)	testprop(c, MASK(DIGITBIT))
 #define lisspace(c)	testprop(c, MASK(SPACEBIT))
 #define lisprint(c)	testprop(c, MASK(PRINTBIT))