diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-02-13 12:25:08 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-02-13 12:25:08 +0000 |
commit | bf828cb365fed61a42de1d867ae0b6ca20d8203d (patch) | |
tree | 7c7589483fa85345871a8c57549fd76e29cc945b /Build/source/libs/lua52/lua-5.2.3/src | |
parent | 4afabb93960c786ec4c71c0e3c41145e9cd5b3e0 (diff) |
lua52: Allow utf-8 chars in identifiers
git-svn-id: svn://tug.org/texlive/trunk@32959 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/lua52/lua-5.2.3/src')
-rw-r--r-- | Build/source/libs/lua52/lua-5.2.3/src/lctype.h | 8 |
1 files changed, 6 insertions, 2 deletions
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)) |