提交 ae8719eb 编写于 作者: B Behdad Esfahbod

[ragel] Switch to -T1 output instead of -F1

Fedora upgraded to ragel 7, which is buggy if char is signed.
Switching to -G2 output fails with sign-compare error:

../../src/hb-buffer-deserialize-json.hh:107:12: error: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘const char’ [-Werror=sign-compare]
    if ( 9u <= ( (*( p))) && ( (*( p))) <= 13u ) {
         ~~~^~~~~~~~~~~~~

Switching to -T1 for now.  It actually results in smaller code,
at the expense of some binary searching instead of flat tables.
In the not distant future, we might actually generate two different
outputs and choose between depending on size-optimize options.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1708
上级 df3f36f0
......@@ -303,7 +303,7 @@ EXTRA_DIST += \
# We decided to add ragel-generated files to git...
#MAINTAINERCLEANFILES += $(RAGEL_GENERATED)
$(srcdir)/%.hh: $(srcdir)/%.rl
$(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \
$(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -T1 -o "$*.hh" "$*.rl") \
|| ($(RM) "$@"; false)
noinst_PROGRAMS = \
......
......@@ -30,165 +30,247 @@
#include "hb.hh"
static const short _deserialize_json_key_offsets[] = {
0, 0, 4, 8, 12, 14, 15, 19,
26, 29, 34, 39, 46, 47, 51, 58,
61, 66, 73, 74, 75, 79, 85, 90,
97, 99, 100, 104, 111, 114, 119, 126,
127, 131, 138, 141, 146, 153, 154, 158,
165, 169, 179, 184, 191, 196, 200, 0
};
static const unsigned char _deserialize_json_trans_keys[] = {
1u, 0u, 0u, 18u, 0u, 2u, 11u, 14u,
16u, 17u, 2u, 2u, 0u, 8u, 0u, 7u,
6u, 7u, 0u, 19u, 0u, 19u, 0u, 19u,
2u, 2u, 0u, 8u, 0u, 7u, 6u, 7u,
0u, 19u, 0u, 19u, 15u, 15u, 2u, 2u,
0u, 8u, 0u, 7u, 0u, 19u, 0u, 19u,
16u, 17u, 2u, 2u, 0u, 8u, 0u, 7u,
6u, 7u, 0u, 19u, 0u, 19u, 2u, 2u,
0u, 8u, 0u, 7u, 6u, 7u, 0u, 19u,
0u, 19u, 2u, 2u, 0u, 8u, 0u, 7u,
9u, 17u, 2u, 17u, 0u, 19u, 0u, 19u,
0u, 10u, 0u, 18u, 1u, 0u, 0u
32u, 123u, 9u, 13u, 32u, 34u, 9u, 13u,
97u, 99u, 100u, 103u, 120u, 121u, 34u, 32u,
58u, 9u, 13u, 32u, 45u, 48u, 9u, 13u,
49u, 57u, 48u, 49u, 57u, 32u, 44u, 125u,
9u, 13u, 32u, 44u, 125u, 9u, 13u, 32u,
44u, 125u, 9u, 13u, 48u, 57u, 34u, 32u,
58u, 9u, 13u, 32u, 45u, 48u, 9u, 13u,
49u, 57u, 48u, 49u, 57u, 32u, 44u, 125u,
9u, 13u, 32u, 44u, 125u, 9u, 13u, 48u,
57u, 108u, 34u, 32u, 58u, 9u, 13u, 32u,
48u, 9u, 13u, 49u, 57u, 32u, 44u, 125u,
9u, 13u, 32u, 44u, 125u, 9u, 13u, 48u,
57u, 120u, 121u, 34u, 32u, 58u, 9u, 13u,
32u, 45u, 48u, 9u, 13u, 49u, 57u, 48u,
49u, 57u, 32u, 44u, 125u, 9u, 13u, 32u,
44u, 125u, 9u, 13u, 48u, 57u, 34u, 32u,
58u, 9u, 13u, 32u, 45u, 48u, 9u, 13u,
49u, 57u, 48u, 49u, 57u, 32u, 44u, 125u,
9u, 13u, 32u, 44u, 125u, 9u, 13u, 48u,
57u, 34u, 32u, 58u, 9u, 13u, 32u, 34u,
48u, 9u, 13u, 49u, 57u, 65u, 90u, 97u,
122u, 34u, 95u, 45u, 46u, 48u, 57u, 65u,
90u, 97u, 122u, 32u, 44u, 125u, 9u, 13u,
32u, 44u, 125u, 9u, 13u, 48u, 57u, 32u,
44u, 93u, 9u, 13u, 32u, 123u, 9u, 13u,
0u
};
static const char _deserialize_json_char_class[] = {
0, 0, 0, 0, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0,
1, 2, 1, 1, 1, 1, 1, 1,
1, 1, 1, 3, 4, 5, 1, 6,
7, 7, 7, 7, 7, 7, 7, 7,
7, 8, 1, 1, 1, 1, 1, 1,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 1, 1, 10, 1, 5, 1,
11, 9, 12, 13, 9, 9, 14, 9,
9, 9, 9, 15, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 16,
17, 9, 18, 1, 19, 0
static const char _deserialize_json_single_lengths[] = {
0, 2, 2, 4, 2, 1, 2, 3,
1, 3, 3, 3, 1, 2, 3, 1,
3, 3, 1, 1, 2, 2, 3, 3,
2, 1, 2, 3, 1, 3, 3, 1,
2, 3, 1, 3, 3, 1, 2, 3,
0, 2, 3, 3, 3, 2, 0, 0
};
static const char _deserialize_json_range_lengths[] = {
0, 1, 1, 0, 0, 0, 1, 2,
1, 1, 1, 2, 0, 1, 2, 1,
1, 2, 0, 0, 1, 2, 1, 2,
0, 0, 1, 2, 1, 1, 2, 0,
1, 2, 1, 1, 2, 0, 1, 2,
2, 4, 1, 2, 1, 1, 0, 0
};
static const short _deserialize_json_index_offsets[] = {
0, 0, 19, 22, 26, 28, 29, 38,
46, 48, 68, 88, 108, 109, 118, 126,
128, 148, 168, 169, 170, 179, 187, 207,
227, 229, 230, 239, 247, 249, 269, 289,
290, 299, 307, 309, 329, 349, 350, 359,
367, 376, 392, 412, 432, 443, 462, 0
0, 0, 4, 8, 13, 16, 18, 22,
28, 31, 36, 41, 47, 49, 53, 59,
62, 67, 73, 75, 77, 81, 86, 91,
97, 100, 102, 106, 112, 115, 120, 126,
128, 132, 138, 141, 146, 152, 154, 158,
164, 167, 174, 179, 185, 190, 194, 0
};
static const char _deserialize_json_trans_cond_spaces[] = {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 0
};
static const short _deserialize_json_trans_offsets[] = {
0, 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, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135,
136, 137, 138, 139, 140, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151,
152, 153, 154, 155, 156, 157, 158, 159,
160, 161, 162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173, 174, 175,
176, 177, 178, 179, 180, 181, 182, 183,
184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 0
};
static const char _deserialize_json_indicies[] = {
0, 1, 1, 1, 1, 1, 1, 1,
static const char _deserialize_json_trans_lengths[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 3, 1, 4, 5, 6,
7, 8, 9, 10, 11, 11, 1, 1,
1, 1, 1, 1, 1, 12, 12, 1,
1, 1, 13, 1, 14, 15, 16, 17,
18, 1, 1, 19, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 20, 21, 1, 1, 3,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 22,
18, 1, 1, 19, 1, 1, 17, 17,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 20, 23, 23, 1, 1,
1, 1, 1, 1, 1, 24, 24, 1,
1, 1, 25, 1, 26, 27, 28, 29,
30, 1, 1, 31, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 32, 30, 1, 1, 31,
1, 1, 29, 29, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 32,
33, 34, 34, 1, 1, 1, 1, 1,
1, 1, 35, 35, 1, 1, 1, 1,
1, 36, 37, 38, 1, 1, 39, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 40, 38,
1, 1, 39, 1, 1, 41, 41, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 40, 42, 43, 44, 44, 1,
1, 1, 1, 1, 1, 1, 45, 45,
1, 1, 1, 46, 1, 47, 48, 49,
50, 51, 1, 1, 52, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 53, 51, 1, 1,
52, 1, 1, 50, 50, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
53, 54, 54, 1, 1, 1, 1, 1,
1, 1, 55, 55, 1, 1, 1, 56,
1, 57, 58, 59, 60, 61, 1, 1,
62, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
63, 61, 1, 1, 62, 1, 1, 60,
60, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 63, 64, 64, 1,
1, 1, 1, 1, 1, 1, 65, 65,
1, 66, 1, 1, 1, 67, 68, 69,
1, 69, 69, 69, 69, 69, 69, 69,
70, 1, 71, 71, 71, 71, 1, 71,
1, 71, 71, 71, 71, 71, 71, 71,
72, 1, 1, 73, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 74, 72, 1, 1, 73,
1, 1, 75, 75, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 74,
76, 1, 1, 77, 1, 1, 1, 1,
1, 1, 78, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 0
};
static const char _deserialize_json_index_defaults[] = {
0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0
1, 1, 1, 0
};
static const char _deserialize_json_trans_cond_spaces[] = {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 0
static const char _deserialize_json_cond_keys[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _deserialize_json_cond_targs[] = {
1, 0, 2, 2, 3, 4, 18, 24,
37, 5, 12, 6, 7, 8, 9, 11,
9, 11, 10, 2, 44, 10, 44, 13,
14, 15, 16, 17, 16, 17, 10, 2,
44, 19, 20, 21, 22, 23, 10, 2,
44, 23, 25, 31, 26, 27, 28, 29,
30, 29, 30, 10, 2, 44, 32, 33,
34, 35, 36, 35, 36, 10, 2, 44,
38, 39, 40, 42, 43, 41, 10, 41,
10, 2, 44, 43, 44, 45, 46, 0
1, 2, 1, 0, 2, 3, 2, 0,
4, 18, 24, 37, 0, 5, 12, 0,
6, 0, 6, 7, 6, 0, 7, 8,
9, 7, 11, 0, 9, 11, 0, 10,
2, 44, 10, 0, 10, 2, 44, 10,
0, 10, 2, 44, 10, 11, 0, 13,
0, 13, 14, 13, 0, 14, 15, 16,
14, 17, 0, 16, 17, 0, 10, 2,
44, 10, 0, 10, 2, 44, 10, 17,
0, 19, 0, 20, 0, 20, 21, 20,
0, 21, 22, 21, 23, 0, 10, 2,
44, 10, 0, 10, 2, 44, 10, 23,
0, 25, 31, 0, 26, 0, 26, 27,
26, 0, 27, 28, 29, 27, 30, 0,
29, 30, 0, 10, 2, 44, 10, 0,
10, 2, 44, 10, 30, 0, 32, 0,
32, 33, 32, 0, 33, 34, 35, 33,
36, 0, 35, 36, 0, 10, 2, 44,
10, 0, 10, 2, 44, 10, 36, 0,
38, 0, 38, 39, 38, 0, 39, 40,
42, 39, 43, 0, 41, 41, 0, 10,
41, 41, 41, 41, 41, 0, 10, 2,
44, 10, 0, 10, 2, 44, 10, 43,
0, 44, 45, 46, 44, 0, 1, 2,
1, 0, 0, 0
};
static const char _deserialize_json_cond_actions[] = {
0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 2, 2,
0, 0, 3, 3, 4, 0, 5, 0,
0, 2, 2, 2, 0, 0, 6, 6,
7, 0, 0, 0, 2, 2, 8, 8,
9, 0, 0, 0, 0, 0, 2, 2,
2, 0, 0, 10, 10, 11, 0, 0,
2, 2, 2, 0, 0, 12, 12, 13,
0, 0, 0, 2, 2, 2, 14, 0,
15, 15, 16, 0, 0, 0, 0, 0
0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2,
2, 0, 2, 0, 0, 0, 0, 3,
3, 4, 3, 0, 0, 0, 5, 0,
0, 3, 3, 4, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 2,
0, 2, 0, 0, 0, 0, 6, 6,
7, 6, 0, 6, 6, 7, 6, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 2, 0, 2, 0, 8, 8,
9, 8, 0, 8, 8, 9, 8, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 2, 0, 2, 0,
0, 0, 0, 10, 10, 11, 10, 0,
10, 10, 11, 10, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 2, 0,
2, 0, 0, 0, 0, 12, 12, 13,
12, 0, 12, 12, 13, 12, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 2, 0, 2, 2, 0, 14,
0, 0, 0, 0, 0, 0, 15, 15,
16, 15, 0, 15, 15, 16, 15, 0,
0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0
};
static const char _deserialize_json_eof_cond_spaces[] = {
-1,
-1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 0
-1, -1, 0
};
static const char _deserialize_json_eof_cond_key_offs[] = {
......@@ -271,28 +353,63 @@ hb_font_t *font)
}
{
unsigned int _trans = 0;const unsigned char * _keys;const char * _inds; {
int _klen;unsigned int _trans = 0;const unsigned char * _keys; {
if ( p == pe )
goto _test_eof;
if ( cs == 0 )
goto _out;
_resume: {
_keys = ( _deserialize_json_trans_keys + ((cs<<1)));
_inds = ( _deserialize_json_indicies + (_deserialize_json_index_offsets[cs]));
_keys = ( _deserialize_json_trans_keys + (_deserialize_json_key_offsets[cs]));
_trans = (unsigned int)_deserialize_json_index_offsets[cs];
if ( ( (*( p))) <= 125 && ( (*( p))) >= 9 )
{
int _ic = (int)_deserialize_json_char_class[(int)( (*( p))) - 9];
if ( _ic <= (int)(*( _keys+1)) && _ic >= (int)(*( _keys)) )
_trans = (unsigned int)(*( _inds + (int)( _ic - (int)(*( _keys)) ) ));
else
_trans = (unsigned int)_deserialize_json_index_defaults[cs];
_klen = (int)_deserialize_json_single_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_upper = _keys + _klen - 1;
const unsigned char *_mid;
while ( 1 ) {
if ( _upper < _lower )
break;
_mid = _lower + ((_upper-_lower) >> 1);
if ( ( (*( p))) < (*( _mid)) )
_upper = _mid - 1;
else if ( ( (*( p))) > (*( _mid)) )
_lower = _mid + 1;
else {
_trans += (unsigned int)(_mid - _keys);
goto _match;
}
}
_keys += _klen;
_trans += (unsigned int)_klen;
}
else {
_trans = (unsigned int)_deserialize_json_index_defaults[cs];
_klen = (int)_deserialize_json_range_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_upper = _keys + (_klen<<1) - 2;
const unsigned char *_mid;
while ( 1 ) {
if ( _upper < _lower )
break;
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
if ( ( (*( p))) < (*( _mid)) )
_upper = _mid - 2;
else if ( ( (*( p))) > (*( _mid + 1)) )
_lower = _mid + 2;
else {
_trans += (unsigned int)((_mid - _keys)>>1);
goto _match;
}
}
_trans += (unsigned int)_klen;
}
goto _match_cond;
_match: {
goto _match_cond;
}
}
_match_cond: {
cs = (int)_deserialize_json_cond_targs[_trans];
......
......@@ -30,76 +30,54 @@
#include "hb.hh"
static const unsigned char _deserialize_text_trans_keys[] = {
1u, 0u, 0u, 10u, 4u, 7u, 6u, 7u,
4u, 7u, 6u, 7u, 6u, 7u, 4u, 7u,
6u, 7u, 3u, 3u, 4u, 7u, 6u, 7u,
3u, 7u, 0u, 12u, 0u, 12u, 1u, 0u,
0u, 10u, 0u, 12u, 0u, 12u, 0u, 12u,
0u, 12u, 0u, 12u, 0u, 12u, 0u, 12u,
0u, 12u, 0u, 12u, 0u, 12u, 0u
static const short _deserialize_text_key_offsets[] = {
0, 0, 10, 14, 17, 21, 24, 27,
31, 34, 35, 39, 42, 45, 53, 58,
58, 68, 78, 84, 89, 96, 104, 111,
117, 125, 134, 0
};
static const char _deserialize_text_char_class[] = {
0, 0, 0, 0, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 3, 4, 5, 1, 6,
7, 7, 7, 7, 7, 7, 7, 7,
7, 1, 1, 1, 8, 1, 1, 9,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 1, 1, 11, 1, 5, 1,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 1, 12, 0
static const unsigned char _deserialize_text_trans_keys[] = {
32u, 48u, 9u, 13u, 49u, 57u, 65u, 90u,
97u, 122u, 45u, 48u, 49u, 57u, 48u, 49u,
57u, 45u, 48u, 49u, 57u, 48u, 49u, 57u,
48u, 49u, 57u, 45u, 48u, 49u, 57u, 48u,
49u, 57u, 44u, 45u, 48u, 49u, 57u, 48u,
49u, 57u, 44u, 48u, 57u, 32u, 43u, 61u,
64u, 93u, 124u, 9u, 13u, 32u, 93u, 124u,
9u, 13u, 32u, 48u, 9u, 13u, 49u, 57u,
65u, 90u, 97u, 122u, 32u, 43u, 61u, 64u,
93u, 124u, 9u, 13u, 48u, 57u, 32u, 44u,
93u, 124u, 9u, 13u, 32u, 93u, 124u, 9u,
13u, 32u, 93u, 124u, 9u, 13u, 48u, 57u,
32u, 44u, 93u, 124u, 9u, 13u, 48u, 57u,
32u, 43u, 64u, 93u, 124u, 9u, 13u, 32u,
43u, 93u, 124u, 9u, 13u, 32u, 43u, 93u,
124u, 9u, 13u, 48u, 57u, 32u, 43u, 64u,
93u, 124u, 9u, 13u, 48u, 57u, 32u, 43u,
61u, 64u, 93u, 95u, 124u, 9u, 13u, 45u,
46u, 48u, 57u, 65u, 90u, 97u, 122u, 0u
};
static const short _deserialize_text_index_offsets[] = {
0, 0, 11, 15, 17, 21, 23, 25,
29, 31, 32, 36, 38, 43, 56, 69,
69, 80, 93, 106, 119, 132, 145, 158,
171, 184, 197, 0
static const char _deserialize_text_single_lengths[] = {
0, 2, 2, 1, 2, 1, 1, 2,
1, 1, 2, 1, 1, 6, 3, 0,
2, 6, 4, 3, 3, 4, 5, 4,
4, 5, 7, 0
};
static const char _deserialize_text_indicies[] = {
0, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 5, 1, 6, 7, 8,
9, 10, 1, 11, 12, 13, 14, 15,
16, 17, 1, 18, 19, 20, 21, 22,
23, 1, 24, 25, 26, 27, 22, 1,
1, 21, 21, 28, 1, 29, 1, 1,
1, 1, 1, 30, 31, 1, 32, 33,
34, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 35, 36, 0, 1, 1,
1, 1, 1, 2, 3, 1, 1, 4,
28, 1, 29, 1, 1, 1, 37, 37,
30, 31, 1, 32, 33, 38, 1, 1,
39, 1, 1, 1, 1, 1, 1, 1,
40, 41, 42, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 43, 44, 42,
1, 1, 1, 1, 1, 14, 14, 1,
1, 1, 43, 44, 38, 1, 1, 39,
1, 1, 9, 9, 1, 1, 1, 40,
41, 45, 1, 46, 1, 1, 1, 1,
1, 1, 47, 1, 48, 49, 50, 1,
51, 1, 1, 1, 1, 1, 1, 1,
1, 52, 53, 50, 1, 51, 1, 1,
1, 27, 27, 1, 1, 1, 52, 53,
45, 1, 46, 1, 1, 1, 54, 54,
1, 47, 1, 48, 49, 28, 1, 29,
1, 55, 55, 55, 55, 30, 31, 55,
32, 33, 0
static const char _deserialize_text_range_lengths[] = {
0, 4, 1, 1, 1, 1, 1, 1,
1, 0, 1, 1, 1, 1, 1, 0,
4, 2, 1, 1, 2, 2, 1, 1,
2, 2, 5, 0
};
static const char _deserialize_text_index_defaults[] = {
0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0
static const char _deserialize_text_index_offsets[] = {
0, 0, 7, 11, 14, 18, 21, 24,
28, 31, 33, 37, 40, 43, 51, 56,
57, 64, 73, 79, 84, 90, 97, 104,
110, 117, 125, 0
};
static const char _deserialize_text_trans_cond_spaces[] = {
......@@ -110,36 +88,136 @@ static const char _deserialize_text_trans_cond_spaces[] = {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
0
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 0
};
static const short _deserialize_text_trans_offsets[] = {
0, 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, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135,
136, 137, 0
};
static const char _deserialize_text_trans_lengths[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0
};
static const char _deserialize_text_cond_keys[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0
};
static const char _deserialize_text_cond_targs[] = {
1, 0, 13, 17, 26, 3, 18, 21,
18, 21, 5, 19, 20, 19, 20, 22,
25, 8, 9, 12, 9, 12, 10, 11,
23, 24, 23, 24, 14, 2, 6, 7,
15, 16, 14, 15, 16, 17, 14, 4,
15, 16, 14, 15, 16, 14, 2, 7,
15, 16, 14, 2, 15, 16, 25, 26,
0
1, 13, 1, 17, 26, 26, 0, 3,
18, 21, 0, 18, 21, 0, 5, 19,
20, 0, 19, 20, 0, 22, 25, 0,
8, 9, 12, 0, 9, 12, 0, 10,
0, 11, 23, 24, 0, 23, 24, 0,
10, 12, 0, 14, 2, 6, 7, 15,
16, 14, 0, 14, 15, 16, 14, 0,
0, 1, 13, 1, 17, 26, 26, 0,
14, 2, 6, 7, 15, 16, 14, 17,
0, 14, 4, 15, 16, 14, 0, 14,
15, 16, 14, 0, 14, 15, 16, 14,
20, 0, 14, 4, 15, 16, 14, 21,
0, 14, 2, 7, 15, 16, 14, 0,
14, 2, 15, 16, 14, 0, 14, 2,
15, 16, 14, 24, 0, 14, 2, 7,
15, 16, 14, 25, 0, 14, 2, 6,
7, 15, 26, 16, 14, 26, 26, 26,
26, 0, 0
};
static const char _deserialize_text_cond_actions[] = {
0, 0, 1, 1, 1, 2, 2, 2,
0, 0, 2, 2, 2, 0, 0, 2,
2, 2, 2, 2, 0, 0, 3, 2,
2, 2, 0, 0, 4, 5, 5, 5,
4, 4, 0, 0, 0, 0, 6, 7,
6, 6, 8, 8, 8, 9, 10, 10,
9, 9, 11, 12, 11, 11, 0, 0,
0
0, 1, 0, 1, 1, 1, 0, 2,
2, 2, 0, 0, 0, 0, 2, 2,
2, 0, 0, 0, 0, 2, 2, 0,
2, 2, 2, 0, 0, 0, 0, 3,
0, 2, 2, 2, 0, 0, 0, 0,
3, 0, 0, 4, 5, 5, 5, 4,
4, 4, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 1, 1, 1, 0,
4, 5, 5, 5, 4, 4, 4, 0,
0, 6, 7, 6, 6, 6, 0, 8,
8, 8, 8, 0, 8, 8, 8, 8,
0, 0, 6, 7, 6, 6, 6, 0,
0, 9, 10, 10, 9, 9, 9, 0,
11, 12, 11, 11, 11, 0, 11, 12,
11, 11, 11, 0, 0, 9, 10, 10,
9, 9, 9, 0, 0, 4, 5, 5,
5, 4, 0, 4, 4, 0, 0, 0,
0, 0, 0
};
static const char _deserialize_text_eof_actions[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 4, 0, 0,
0, 4, 6, 8, 8, 6, 9, 11,
11, 9, 4, 0
};
static const char _deserialize_text_eof_cond_spaces[] = {
-1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 0
-1, -1, -1, -1, -1, 0
};
static const char _deserialize_text_eof_cond_key_offs[] = {
......@@ -160,13 +238,6 @@ static const char _deserialize_text_eof_cond_keys[] = {
0
};
static const char _deserialize_text_eof_actions[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 4, 0, 0,
0, 4, 6, 8, 8, 6, 9, 11,
11, 9, 4, 0
};
static const char _deserialize_text_nfa_targs[] = {
0, 0
};
......@@ -224,28 +295,63 @@ hb_font_t *font)
{
int _cpc;
int _klen;const char * _cekeys;unsigned int _trans = 0;const unsigned char * _keys;const char * _inds; {
int _klen;const char * _cekeys;unsigned int _trans = 0;const unsigned char * _keys; {
if ( p == pe )
goto _test_eof;
if ( cs == 0 )
goto _out;
_resume: {
_keys = ( _deserialize_text_trans_keys + ((cs<<1)));
_inds = ( _deserialize_text_indicies + (_deserialize_text_index_offsets[cs]));
_keys = ( _deserialize_text_trans_keys + (_deserialize_text_key_offsets[cs]));
_trans = (unsigned int)_deserialize_text_index_offsets[cs];
if ( ( (*( p))) <= 124 && ( (*( p))) >= 9 )
{
int _ic = (int)_deserialize_text_char_class[(int)( (*( p))) - 9];
if ( _ic <= (int)(*( _keys+1)) && _ic >= (int)(*( _keys)) )
_trans = (unsigned int)(*( _inds + (int)( _ic - (int)(*( _keys)) ) ));
else
_trans = (unsigned int)_deserialize_text_index_defaults[cs];
_klen = (int)_deserialize_text_single_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_upper = _keys + _klen - 1;
const unsigned char *_mid;
while ( 1 ) {
if ( _upper < _lower )
break;
_mid = _lower + ((_upper-_lower) >> 1);
if ( ( (*( p))) < (*( _mid)) )
_upper = _mid - 1;
else if ( ( (*( p))) > (*( _mid)) )
_lower = _mid + 1;
else {
_trans += (unsigned int)(_mid - _keys);
goto _match;
}
}
_keys += _klen;
_trans += (unsigned int)_klen;
}
else {
_trans = (unsigned int)_deserialize_text_index_defaults[cs];
_klen = (int)_deserialize_text_range_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_upper = _keys + (_klen<<1) - 2;
const unsigned char *_mid;
while ( 1 ) {
if ( _upper < _lower )
break;
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
if ( ( (*( p))) < (*( _mid)) )
_upper = _mid - 2;
else if ( ( (*( p))) > (*( _mid + 1)) )
_lower = _mid + 2;
else {
_trans += (unsigned int)((_mid - _keys)>>1);
goto _match;
}
}
_trans += (unsigned int)_klen;
}
goto _match_cond;
_match: {
goto _match_cond;
}
}
_match_cond: {
cs = (int)_deserialize_text_cond_targs[_trans];
......
......@@ -30,78 +30,68 @@
#include "hb.hh"
static const unsigned char _khmer_syllable_machine_trans_keys[] = {
2u, 8u, 2u, 6u, 2u, 8u, 2u, 6u,
0u, 0u, 2u, 6u, 2u, 8u, 2u, 6u,
2u, 8u, 2u, 6u, 2u, 6u, 2u, 8u,
2u, 6u, 0u, 0u, 2u, 6u, 2u, 8u,
2u, 6u, 2u, 8u, 2u, 6u, 2u, 8u,
0u, 11u, 2u, 11u, 2u, 11u, 2u, 11u,
7u, 7u, 2u, 7u, 2u, 11u, 2u, 11u,
2u, 11u, 0u, 0u, 2u, 8u, 2u, 11u,
2u, 11u, 7u, 7u, 2u, 7u, 2u, 11u,
2u, 11u, 0u, 0u, 2u, 11u, 2u, 11u,
0u
static const short _khmer_syllable_machine_key_offsets[] = {
0, 5, 8, 12, 15, 18, 21, 25,
28, 32, 35, 38, 42, 45, 48, 51,
55, 58, 62, 65, 70, 84, 94, 103,
109, 110, 115, 122, 130, 139, 142, 146,
155, 161, 162, 167, 174, 182, 185, 195,
0
};
static const char _khmer_syllable_machine_char_class[] = {
0, 0, 1, 1, 2, 2, 1, 1,
1, 1, 3, 3, 1, 4, 1, 0,
1, 1, 1, 5, 6, 7, 1, 1,
1, 8, 9, 10, 11, 0
static const unsigned char _khmer_syllable_machine_trans_keys[] = {
20u, 21u, 26u, 5u, 6u, 21u, 5u, 6u,
21u, 26u, 5u, 6u, 21u, 5u, 6u, 16u,
1u, 2u, 21u, 5u, 6u, 21u, 26u, 5u,
6u, 21u, 5u, 6u, 21u, 26u, 5u, 6u,
21u, 5u, 6u, 21u, 5u, 6u, 21u, 26u,
5u, 6u, 21u, 5u, 6u, 16u, 1u, 2u,
21u, 5u, 6u, 21u, 26u, 5u, 6u, 21u,
5u, 6u, 21u, 26u, 5u, 6u, 21u, 5u,
6u, 20u, 21u, 26u, 5u, 6u, 14u, 16u,
21u, 22u, 26u, 27u, 28u, 29u, 1u, 2u,
5u, 6u, 11u, 12u, 14u, 20u, 21u, 22u,
26u, 27u, 28u, 29u, 5u, 6u, 14u, 21u,
22u, 26u, 27u, 28u, 29u, 5u, 6u, 14u,
21u, 22u, 29u, 5u, 6u, 22u, 14u, 21u,
22u, 5u, 6u, 14u, 21u, 22u, 26u, 29u,
5u, 6u, 14u, 21u, 22u, 26u, 27u, 29u,
5u, 6u, 14u, 21u, 22u, 26u, 27u, 28u,
29u, 5u, 6u, 16u, 1u, 2u, 21u, 26u,
5u, 6u, 14u, 21u, 22u, 26u, 27u, 28u,
29u, 5u, 6u, 14u, 21u, 22u, 29u, 5u,
6u, 22u, 14u, 21u, 22u, 5u, 6u, 14u,
21u, 22u, 26u, 29u, 5u, 6u, 14u, 21u,
22u, 26u, 27u, 29u, 5u, 6u, 16u, 1u,
2u, 14u, 20u, 21u, 22u, 26u, 27u, 28u,
29u, 5u, 6u, 14u, 21u, 22u, 26u, 27u,
28u, 29u, 5u, 6u, 0u
};
static const short _khmer_syllable_machine_index_offsets[] = {
0, 7, 12, 19, 24, 25, 30, 37,
42, 49, 54, 59, 66, 71, 72, 77,
84, 89, 96, 101, 108, 120, 130, 140,
150, 151, 157, 167, 177, 187, 188, 195,
205, 215, 216, 222, 232, 242, 243, 253,
static const char _khmer_syllable_machine_single_lengths[] = {
3, 1, 2, 1, 1, 1, 2, 1,
2, 1, 1, 2, 1, 1, 1, 2,
1, 2, 1, 3, 8, 8, 7, 4,
1, 3, 5, 6, 7, 1, 2, 7,
4, 1, 3, 5, 6, 1, 8, 7,
0
};
static const char _khmer_syllable_machine_indicies[] = {
1, 0, 0, 2, 3, 0, 4, 1,
0, 0, 0, 3, 1, 0, 0, 0,
3, 0, 4, 5, 0, 0, 0, 4,
6, 7, 0, 0, 0, 8, 9, 0,
0, 0, 10, 0, 4, 9, 0, 0,
0, 10, 11, 0, 0, 0, 12, 0,
4, 11, 0, 0, 0, 12, 14, 13,
13, 13, 15, 14, 16, 16, 16, 15,
16, 17, 18, 16, 16, 16, 17, 19,
20, 16, 16, 16, 21, 22, 16, 16,
16, 23, 16, 17, 22, 16, 16, 16,
23, 24, 16, 16, 16, 25, 16, 17,
24, 16, 16, 16, 25, 14, 16, 16,
26, 15, 16, 17, 28, 27, 29, 2,
30, 27, 15, 19, 17, 23, 25, 21,
32, 31, 33, 2, 3, 6, 4, 10,
12, 8, 34, 31, 35, 31, 3, 6,
4, 10, 12, 8, 5, 31, 35, 31,
4, 6, 31, 31, 31, 8, 6, 7,
31, 35, 31, 8, 6, 36, 31, 35,
31, 10, 6, 4, 31, 31, 8, 37,
31, 35, 31, 12, 6, 4, 10, 31,
8, 34, 31, 33, 31, 3, 6, 4,
10, 12, 8, 28, 14, 38, 38, 38,
15, 38, 17, 40, 39, 41, 39, 15,
19, 17, 23, 25, 21, 18, 39, 41,
39, 17, 19, 39, 39, 39, 21, 19,
20, 39, 41, 39, 21, 19, 42, 39,
41, 39, 23, 19, 17, 39, 39, 21,
43, 39, 41, 39, 25, 19, 17, 23,
39, 21, 44, 45, 39, 30, 26, 15,
19, 17, 23, 25, 21, 40, 39, 30,
39, 15, 19, 17, 23, 25, 21, 0
static const char _khmer_syllable_machine_range_lengths[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 3, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 1, 1, 1, 1, 1,
0
};
static const char _khmer_syllable_machine_index_defaults[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 13, 16, 16, 16, 16, 16,
16, 16, 16, 16, 27, 31, 31, 31,
31, 31, 31, 31, 31, 31, 38, 39,
39, 39, 39, 39, 39, 39, 39, 39,
static const short _khmer_syllable_machine_index_offsets[] = {
0, 5, 8, 12, 15, 18, 21, 25,
28, 32, 35, 38, 42, 45, 48, 51,
55, 58, 62, 65, 70, 82, 92, 101,
107, 109, 114, 121, 129, 138, 141, 145,
154, 160, 162, 167, 174, 182, 185, 195,
0
};
......@@ -111,25 +101,202 @@ static const char _khmer_syllable_machine_trans_cond_spaces[] = {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 0
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 0
};
static const short _khmer_syllable_machine_trans_offsets[] = {
0, 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, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135,
136, 137, 138, 139, 140, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151,
152, 153, 154, 155, 156, 157, 158, 159,
160, 161, 162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173, 174, 175,
176, 177, 178, 179, 180, 181, 182, 183,
184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197, 198, 199,
200, 201, 202, 203, 204, 205, 206, 207,
208, 209, 210, 211, 212, 213, 214, 215,
216, 217, 218, 219, 220, 221, 222, 223,
224, 225, 226, 227, 228, 229, 230, 231,
232, 233, 234, 235, 236, 237, 238, 239,
240, 241, 242, 0
};
static const char _khmer_syllable_machine_trans_lengths[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0
};
static const char _khmer_syllable_machine_cond_keys[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _khmer_syllable_machine_cond_targs[] = {
20, 1, 28, 22, 23, 3, 24, 5,
25, 7, 26, 9, 27, 20, 10, 31,
20, 32, 12, 33, 14, 34, 16, 35,
18, 36, 39, 20, 21, 30, 37, 20,
0, 29, 2, 4, 6, 8, 20, 20,
11, 13, 15, 17, 38, 19, 0
28, 22, 23, 1, 20, 22, 1, 20,
22, 23, 1, 20, 23, 3, 20, 24,
24, 20, 25, 5, 20, 26, 23, 7,
20, 26, 7, 20, 27, 23, 9, 20,
27, 9, 20, 31, 10, 20, 31, 32,
10, 20, 32, 12, 20, 33, 33, 20,
34, 14, 20, 35, 32, 16, 20, 35,
16, 20, 36, 32, 18, 20, 36, 18,
20, 39, 31, 32, 10, 20, 37, 21,
31, 33, 32, 35, 36, 34, 21, 30,
28, 20, 29, 28, 22, 24, 23, 26,
27, 25, 0, 20, 4, 22, 24, 23,
26, 27, 25, 2, 20, 4, 23, 24,
25, 3, 20, 24, 20, 4, 25, 24,
5, 20, 4, 26, 24, 23, 25, 6,
20, 4, 27, 24, 23, 26, 25, 8,
20, 29, 22, 24, 23, 26, 27, 25,
2, 20, 21, 21, 20, 31, 32, 10,
20, 13, 31, 33, 32, 35, 36, 34,
11, 20, 13, 32, 33, 34, 12, 20,
33, 20, 13, 34, 33, 14, 20, 13,
35, 33, 32, 34, 15, 20, 13, 36,
33, 32, 35, 34, 17, 20, 38, 38,
20, 37, 39, 31, 33, 32, 35, 36,
34, 19, 20, 37, 31, 33, 32, 35,
36, 34, 11, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 0
};
static const char _khmer_syllable_machine_cond_actions[] = {
1, 0, 2, 2, 2, 0, 0, 0,
2, 0, 2, 0, 2, 3, 0, 4,
5, 2, 0, 0, 0, 2, 0, 2,
0, 2, 4, 8, 2, 9, 0, 10,
0, 0, 0, 0, 0, 0, 11, 12,
0, 0, 0, 0, 4, 0, 0
2, 2, 2, 0, 1, 2, 0, 1,
2, 2, 0, 1, 2, 0, 1, 0,
0, 1, 2, 0, 1, 2, 2, 0,
1, 2, 0, 1, 2, 2, 0, 1,
2, 0, 1, 4, 0, 3, 4, 2,
0, 5, 2, 0, 5, 0, 0, 5,
2, 0, 5, 2, 2, 0, 5, 2,
0, 5, 2, 2, 0, 5, 2, 0,
5, 4, 4, 2, 0, 5, 0, 2,
4, 0, 2, 2, 2, 2, 2, 9,
2, 8, 0, 2, 2, 0, 2, 2,
2, 2, 0, 10, 0, 2, 0, 2,
2, 2, 2, 0, 10, 0, 2, 0,
2, 0, 10, 0, 10, 0, 2, 0,
0, 10, 0, 2, 0, 2, 2, 0,
10, 0, 2, 0, 2, 2, 2, 0,
10, 0, 2, 0, 2, 2, 2, 2,
0, 10, 2, 2, 10, 4, 2, 0,
11, 0, 4, 0, 2, 2, 2, 2,
0, 12, 0, 2, 0, 2, 0, 12,
0, 12, 0, 2, 0, 0, 12, 0,
2, 0, 2, 2, 0, 12, 0, 2,
0, 2, 2, 2, 0, 12, 4, 4,
12, 0, 4, 4, 0, 2, 2, 2,
2, 0, 12, 0, 4, 0, 2, 2,
2, 2, 0, 12, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 3, 5,
5, 5, 5, 5, 5, 5, 5, 5,
10, 10, 10, 10, 10, 10, 10, 10,
10, 11, 12, 12, 12, 12, 12, 12,
12, 12, 12, 0
};
static const char _khmer_syllable_machine_to_state_actions[] = {
......@@ -151,12 +318,12 @@ static const char _khmer_syllable_machine_from_state_actions[] = {
};
static const char _khmer_syllable_machine_eof_cond_spaces[] = {
-1, -1,
-1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 0
-1, -1, -1, 0
};
static const char _khmer_syllable_machine_eof_cond_key_offs[] = {
......@@ -181,12 +348,12 @@ static const char _khmer_syllable_machine_eof_cond_keys[] = {
0
};
static const char _khmer_syllable_machine_eof_trans[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 14, 17, 17, 17, 17, 17,
17, 17, 17, 17, 0, 32, 32, 32,
32, 32, 32, 32, 32, 32, 39, 40,
40, 40, 40, 40, 40, 40, 40, 40,
static const short _khmer_syllable_machine_eof_trans[] = {
205, 206, 207, 208, 209, 210, 211, 212,
213, 214, 215, 216, 217, 218, 219, 220,
221, 222, 223, 224, 0, 225, 226, 227,
228, 229, 230, 231, 232, 233, 234, 235,
236, 237, 238, 239, 240, 241, 242, 243,
0
};
......@@ -252,7 +419,7 @@ find_syllables (hb_buffer_t *buffer)
{
int _cpc;
int _klen;const char * _cekeys;unsigned int _trans = 0;const unsigned char * _keys;const char * _inds; {
int _klen;const char * _cekeys;unsigned int _trans = 0;const unsigned char * _keys; {
if ( p == pe )
goto _test_eof;
_resume: {
......@@ -265,22 +432,57 @@ find_syllables (hb_buffer_t *buffer)
break; }
}
_keys = ( _khmer_syllable_machine_trans_keys + ((cs<<1)));
_inds = ( _khmer_syllable_machine_indicies + (_khmer_syllable_machine_index_offsets[cs]));
_keys = ( _khmer_syllable_machine_trans_keys + (_khmer_syllable_machine_key_offsets[cs]));
_trans = (unsigned int)_khmer_syllable_machine_index_offsets[cs];
if ( (info[p].khmer_category()) <= 29 && (info[p].khmer_category()) >= 1 )
{
int _ic = (int)_khmer_syllable_machine_char_class[(int)(info[p].khmer_category()) - 1];
if ( _ic <= (int)(*( _keys+1)) && _ic >= (int)(*( _keys)) )
_trans = (unsigned int)(*( _inds + (int)( _ic - (int)(*( _keys)) ) ));
else
_trans = (unsigned int)_khmer_syllable_machine_index_defaults[cs];
_klen = (int)_khmer_syllable_machine_single_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_upper = _keys + _klen - 1;
const unsigned char *_mid;
while ( 1 ) {
if ( _upper < _lower )
break;
_mid = _lower + ((_upper-_lower) >> 1);
if ( (info[p].khmer_category()) < (*( _mid)) )
_upper = _mid - 1;
else if ( (info[p].khmer_category()) > (*( _mid)) )
_lower = _mid + 1;
else {
_trans += (unsigned int)(_mid - _keys);
goto _match;
}
}
_keys += _klen;
_trans += (unsigned int)_klen;
}
else {
_trans = (unsigned int)_khmer_syllable_machine_index_defaults[cs];
_klen = (int)_khmer_syllable_machine_range_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_upper = _keys + (_klen<<1) - 2;
const unsigned char *_mid;
while ( 1 ) {
if ( _upper < _lower )
break;
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
if ( (info[p].khmer_category()) < (*( _mid)) )
_upper = _mid - 2;
else if ( (info[p].khmer_category()) > (*( _mid + 1)) )
_lower = _mid + 2;
else {
_trans += (unsigned int)((_mid - _keys)>>1);
goto _match;
}
}
_trans += (unsigned int)_klen;
}
goto _match_cond;
_match: {
goto _match_cond;
}
}
_match_cond: {
cs = (int)_khmer_syllable_machine_cond_targs[_trans];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册