summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-02-13 12:25:08 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-02-13 12:25:08 +0000
commitbf828cb365fed61a42de1d867ae0b6ca20d8203d (patch)
tree7c7589483fa85345871a8c57549fd76e29cc945b /Build
parent4afabb93960c786ec4c71c0e3c41145e9cd5b3e0 (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')
-rw-r--r--Build/source/libs/lua52/lua-5.2.3-PATCHES/ChangeLog5
-rw-r--r--Build/source/libs/lua52/lua-5.2.3-PATCHES/patch-01-utf-826
-rw-r--r--Build/source/libs/lua52/lua-5.2.3/src/lctype.h8
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))