diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/libs/lua52/lua-5.2.3-PATCHES/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/libs/lua52/lua-5.2.3-PATCHES/patch-01-utf-8 | 26 | ||||
-rw-r--r-- | Build/source/libs/lua52/lua-5.2.3/src/lctype.h | 8 |
3 files changed, 37 insertions, 2 deletions
diff --git a/Build/source/libs/lua52/lua-5.2.3-PATCHES/ChangeLog b/Build/source/libs/lua52/lua-5.2.3-PATCHES/ChangeLog index f79e6607061..b2a675717af 100644 --- a/Build/source/libs/lua52/lua-5.2.3-PATCHES/ChangeLog +++ b/Build/source/libs/lua52/lua-5.2.3-PATCHES/ChangeLog @@ -1,3 +1,8 @@ +2014-02-13 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-01-utf-8 (new): Allow utf-8 chars in identifiers. + From Luigi Scarso <luigi.scarso@gmail.com>. + 2012-12-07 Peter Breitenlohner <peb@mppmu.mpg.de> Import lua-5.2.3/ from http://www.lua.org/ftp/lua-5.2.3.tar.gz. diff --git a/Build/source/libs/lua52/lua-5.2.3-PATCHES/patch-01-utf-8 b/Build/source/libs/lua52/lua-5.2.3-PATCHES/patch-01-utf-8 new file mode 100644 index 00000000000..d3f299ce16e --- /dev/null +++ b/Build/source/libs/lua52/lua-5.2.3-PATCHES/patch-01-utf-8 @@ -0,0 +1,26 @@ +diff -ur lua-5.2.3.orig/src/lctype.h lua-5.2.3/src/lctype.h +--- lua-5.2.3.orig/src/lctype.h 2013-04-12 20:48:47.000000000 +0200 ++++ lua-5.2.3/src/lctype.h 2014-02-13 13:17:33.000000000 +0100 +@@ -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)) diff --git a/Build/source/libs/lua52/lua-5.2.3/src/lctype.h b/Build/source/libs/lua52/lua-5.2.3/src/lctype.h index b09b21a337c..a963eb9015f 100644 --- a/Build/source/libs/lua52/lua-5.2.3/src/lctype.h +++ b/Build/source/libs/lua52/lua-5.2.3/src/lctype.h @@ -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)) |