diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-03 20:50:11 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-03 20:50:11 +0100 |
commit | 4cf52fc0bc3b80c0ef6c58c5db4413ebdafe661c (patch) | |
tree | 676b26b024117cf656080a011e3d17b8fb6889af /lib/unigbrk/uc-is-grapheme-break.c | |
parent | 1ecbfbb92248e67b564f5b144c4671ccaa86ee2f (diff) | |
parent | 44ff3127b1e57b703c2a73a24f7ab38e4aad8ae4 (diff) |
Merge branch 'release/0.9.8-1'0.9.8-1
Diffstat (limited to 'lib/unigbrk/uc-is-grapheme-break.c')
-rw-r--r-- | lib/unigbrk/uc-is-grapheme-break.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/unigbrk/uc-is-grapheme-break.c b/lib/unigbrk/uc-is-grapheme-break.c index e7b9094..6b58bc7 100644 --- a/lib/unigbrk/uc-is-grapheme-break.c +++ b/lib/unigbrk/uc-is-grapheme-break.c @@ -1,5 +1,5 @@ /* Grapheme cluster break function. - Copyright (C) 2010-2016 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010. This program is free software: you can redistribute it and/or @@ -22,7 +22,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> @@ -56,19 +56,22 @@ /* GB8 */ \ ((A) == GBP_LVT || (A) == GBP_T) && (B) == GBP_T ? false : \ \ - /* GB8a */ \ - (A) == GBP_RI && (B) == GBP_RI ? false : \ - \ /* GB9 */ \ - (B) == GBP_EXTEND ? false : \ + (B) == GBP_EXTEND || (B) == GBP_ZWJ ? false : \ \ /* GB9a */ \ (B) == GBP_SPACINGMARK ? false : \ \ /* GB9b */ \ - (A) == GBP_PREPEND ? false \ + (A) == GBP_PREPEND ? false : \ \ - /* GB10 */ \ + /* GB10 -- incomplete */ \ + ((A) == GBP_EB || (A) == GBP_EBG) && (B) == GBP_EM ? false : \ + \ + /* GB11 */ \ + (A) == GBP_ZWJ && ((B) == GBP_GAZ || (B) == GBP_EBG) ? false \ + \ + /* GB999 */ \ : true) #define UC_GRAPHEME_BREAKS_FOR(A) \ @@ -84,9 +87,14 @@ | (UC_IS_GRAPHEME_BREAK(A, GBP_T) << GBP_T) \ | (UC_IS_GRAPHEME_BREAK(A, GBP_LV) << GBP_LV) \ | (UC_IS_GRAPHEME_BREAK(A, GBP_LVT) << GBP_LVT) \ - | (UC_IS_GRAPHEME_BREAK(A, GBP_RI) << GBP_RI)) + | (UC_IS_GRAPHEME_BREAK(A, GBP_RI) << GBP_RI) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_ZWJ) << GBP_ZWJ) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_EB) << GBP_EB) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_EM) << GBP_EM) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_GAZ) << GBP_GAZ) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_EBG) << GBP_EBG)) -static const unsigned short int gb_table[13] = +static const unsigned long int gb_table[18] = { UC_GRAPHEME_BREAKS_FOR(0), /* GBP_OTHER */ UC_GRAPHEME_BREAKS_FOR(1), /* GBP_CR */ @@ -101,6 +109,11 @@ static const unsigned short int gb_table[13] = UC_GRAPHEME_BREAKS_FOR(10), /* GBP_LV */ UC_GRAPHEME_BREAKS_FOR(11), /* GBP_LVT */ UC_GRAPHEME_BREAKS_FOR(12), /* GBP_RI */ + UC_GRAPHEME_BREAKS_FOR(13), /* GBP_ZWJ */ + UC_GRAPHEME_BREAKS_FOR(14), /* GBP_EB */ + UC_GRAPHEME_BREAKS_FOR(15), /* GBP_EM */ + UC_GRAPHEME_BREAKS_FOR(16), /* GBP_GAZ */ + UC_GRAPHEME_BREAKS_FOR(17), /* GBP_EBG */ }; bool |