Fixed broken patch
[platform/upstream/harfbuzz.git] / src / hb-ot-shape-complex-myanmar-machine.hh
1
2 #line 1 "hb-ot-shape-complex-myanmar-machine.rl"
3 /*
4  * Copyright © 2011,2012  Google, Inc.
5  *
6  *  This is part of HarfBuzz, a text shaping library.
7  *
8  * Permission is hereby granted, without written agreement and without
9  * license or royalty fees, to use, copy, modify, and distribute this
10  * software and its documentation for any purpose, provided that the
11  * above copyright notice and the following two paragraphs appear in
12  * all copies of this software.
13  *
14  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
15  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
17  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18  * DAMAGE.
19  *
20  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
21  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
23  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
24  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25  *
26  * Google Author(s): Behdad Esfahbod
27  */
28
29 #ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH
30 #define HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH
31
32 #include "hb.hh"
33
34
35 #line 36 "hb-ot-shape-complex-myanmar-machine.hh"
36 static const unsigned char _myanmar_syllable_machine_trans_keys[] = {
37         1u, 32u, 3u, 30u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 
38         3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 16u, 3u, 29u, 3u, 29u, 3u, 29u, 
39         3u, 29u, 3u, 29u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 
40         5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 
41         3u, 29u, 3u, 29u, 1u, 16u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 
42         3u, 29u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 30u, 
43         3u, 29u, 1u, 32u, 1u, 32u, 8u, 8u, 0
44 };
45
46 static const char _myanmar_syllable_machine_key_spans[] = {
47         32, 28, 25, 4, 25, 23, 21, 21, 
48         27, 27, 27, 27, 16, 27, 27, 27, 
49         27, 27, 28, 27, 27, 27, 27, 27, 
50         25, 4, 25, 23, 21, 21, 27, 27, 
51         27, 27, 16, 28, 27, 27, 27, 27, 
52         27, 28, 27, 27, 27, 27, 27, 28, 
53         27, 32, 32, 1
54 };
55
56 static const short _myanmar_syllable_machine_index_offsets[] = {
57         0, 33, 62, 88, 93, 119, 143, 165, 
58         187, 215, 243, 271, 299, 316, 344, 372, 
59         400, 428, 456, 485, 513, 541, 569, 597, 
60         625, 651, 656, 682, 706, 728, 750, 778, 
61         806, 834, 862, 879, 908, 936, 964, 992, 
62         1020, 1048, 1077, 1105, 1133, 1161, 1189, 1217, 
63         1246, 1274, 1307, 1340
64 };
65
66 static const char _myanmar_syllable_machine_indicies[] = {
67         1, 1, 2, 3, 4, 4, 0, 5, 
68         0, 6, 1, 0, 0, 0, 0, 7, 
69         0, 8, 9, 0, 10, 11, 12, 13, 
70         14, 15, 16, 17, 18, 19, 20, 1, 
71         0, 22, 23, 24, 24, 21, 25, 21, 
72         26, 21, 21, 21, 21, 21, 21, 21, 
73         27, 21, 21, 28, 29, 30, 31, 32, 
74         33, 34, 35, 36, 37, 21, 24, 24, 
75         21, 25, 21, 21, 21, 21, 21, 21, 
76         21, 21, 21, 38, 21, 21, 21, 21, 
77         21, 21, 32, 21, 21, 21, 36, 21, 
78         24, 24, 21, 25, 21, 24, 24, 21, 
79         25, 21, 21, 21, 21, 21, 21, 21, 
80         21, 21, 21, 21, 21, 21, 21, 21, 
81         21, 32, 21, 21, 21, 36, 21, 39, 
82         21, 24, 24, 21, 25, 21, 32, 21, 
83         21, 21, 21, 21, 21, 21, 40, 21, 
84         21, 21, 21, 21, 21, 32, 21, 24, 
85         24, 21, 25, 21, 21, 21, 21, 21, 
86         21, 21, 21, 21, 40, 21, 21, 21, 
87         21, 21, 21, 32, 21, 24, 24, 21, 
88         25, 21, 21, 21, 21, 21, 21, 21, 
89         21, 21, 21, 21, 21, 21, 21, 21, 
90         21, 32, 21, 22, 21, 24, 24, 21, 
91         25, 21, 26, 21, 21, 21, 21, 21, 
92         21, 21, 41, 21, 21, 41, 21, 21, 
93         21, 32, 42, 21, 21, 36, 21, 22, 
94         21, 24, 24, 21, 25, 21, 26, 21, 
95         21, 21, 21, 21, 21, 21, 21, 21, 
96         21, 21, 21, 21, 21, 32, 21, 21, 
97         21, 36, 21, 22, 21, 24, 24, 21, 
98         25, 21, 26, 21, 21, 21, 21, 21, 
99         21, 21, 41, 21, 21, 21, 21, 21, 
100         21, 32, 42, 21, 21, 36, 21, 22, 
101         21, 24, 24, 21, 25, 21, 26, 21, 
102         21, 21, 21, 21, 21, 21, 21, 21, 
103         21, 21, 21, 21, 21, 32, 42, 21, 
104         21, 36, 21, 1, 1, 21, 21, 21, 
105         21, 21, 21, 21, 21, 21, 21, 21, 
106         21, 21, 1, 21, 22, 21, 24, 24, 
107         21, 25, 21, 26, 21, 21, 21, 21, 
108         21, 21, 21, 27, 21, 21, 28, 29, 
109         30, 31, 32, 33, 34, 35, 36, 21, 
110         22, 21, 24, 24, 21, 25, 21, 26, 
111         21, 21, 21, 21, 21, 21, 21, 43, 
112         21, 21, 21, 21, 21, 21, 32, 33, 
113         34, 35, 36, 21, 22, 21, 24, 24, 
114         21, 25, 21, 26, 21, 21, 21, 21, 
115         21, 21, 21, 21, 21, 21, 21, 21, 
116         21, 21, 32, 33, 34, 35, 36, 21, 
117         22, 21, 24, 24, 21, 25, 21, 26, 
118         21, 21, 21, 21, 21, 21, 21, 21, 
119         21, 21, 21, 21, 21, 21, 32, 33, 
120         34, 21, 36, 21, 22, 21, 24, 24, 
121         21, 25, 21, 26, 21, 21, 21, 21, 
122         21, 21, 21, 21, 21, 21, 21, 21, 
123         21, 21, 32, 21, 34, 21, 36, 21, 
124         22, 21, 24, 24, 21, 25, 21, 26, 
125         21, 21, 21, 21, 21, 21, 21, 21, 
126         21, 21, 21, 21, 21, 21, 32, 33, 
127         34, 35, 36, 43, 21, 22, 21, 24, 
128         24, 21, 25, 21, 26, 21, 21, 21, 
129         21, 21, 21, 21, 21, 21, 21, 28, 
130         21, 30, 21, 32, 33, 34, 35, 36, 
131         21, 22, 21, 24, 24, 21, 25, 21, 
132         26, 21, 21, 21, 21, 21, 21, 21, 
133         43, 21, 21, 28, 21, 21, 21, 32, 
134         33, 34, 35, 36, 21, 22, 21, 24, 
135         24, 21, 25, 21, 26, 21, 21, 21, 
136         21, 21, 21, 21, 44, 21, 21, 28, 
137         29, 30, 21, 32, 33, 34, 35, 36, 
138         21, 22, 21, 24, 24, 21, 25, 21, 
139         26, 21, 21, 21, 21, 21, 21, 21, 
140         21, 21, 21, 28, 29, 30, 21, 32, 
141         33, 34, 35, 36, 21, 22, 23, 24, 
142         24, 21, 25, 21, 26, 21, 21, 21, 
143         21, 21, 21, 21, 27, 21, 21, 28, 
144         29, 30, 31, 32, 33, 34, 35, 36, 
145         21, 46, 46, 45, 5, 45, 45, 45, 
146         45, 45, 45, 45, 45, 45, 47, 45, 
147         45, 45, 45, 45, 45, 14, 45, 45, 
148         45, 18, 45, 46, 46, 45, 5, 45, 
149         46, 46, 45, 5, 45, 45, 45, 45, 
150         45, 45, 45, 45, 45, 45, 45, 45, 
151         45, 45, 45, 45, 14, 45, 45, 45, 
152         18, 45, 48, 45, 46, 46, 45, 5, 
153         45, 14, 45, 45, 45, 45, 45, 45, 
154         45, 49, 45, 45, 45, 45, 45, 45, 
155         14, 45, 46, 46, 45, 5, 45, 45, 
156         45, 45, 45, 45, 45, 45, 45, 49, 
157         45, 45, 45, 45, 45, 45, 14, 45, 
158         46, 46, 45, 5, 45, 45, 45, 45, 
159         45, 45, 45, 45, 45, 45, 45, 45, 
160         45, 45, 45, 45, 14, 45, 2, 45, 
161         46, 46, 45, 5, 45, 6, 45, 45, 
162         45, 45, 45, 45, 45, 50, 45, 45, 
163         50, 45, 45, 45, 14, 51, 45, 45, 
164         18, 45, 2, 45, 46, 46, 45, 5, 
165         45, 6, 45, 45, 45, 45, 45, 45, 
166         45, 45, 45, 45, 45, 45, 45, 45, 
167         14, 45, 45, 45, 18, 45, 2, 45, 
168         46, 46, 45, 5, 45, 6, 45, 45, 
169         45, 45, 45, 45, 45, 50, 45, 45, 
170         45, 45, 45, 45, 14, 51, 45, 45, 
171         18, 45, 2, 45, 46, 46, 45, 5, 
172         45, 6, 45, 45, 45, 45, 45, 45, 
173         45, 45, 45, 45, 45, 45, 45, 45, 
174         14, 51, 45, 45, 18, 45, 52, 52, 
175         45, 45, 45, 45, 45, 45, 45, 45, 
176         45, 45, 45, 45, 45, 52, 45, 2, 
177         3, 46, 46, 45, 5, 45, 6, 45, 
178         45, 45, 45, 45, 45, 45, 8, 45, 
179         45, 10, 11, 12, 13, 14, 15, 16, 
180         17, 18, 19, 45, 2, 45, 46, 46, 
181         45, 5, 45, 6, 45, 45, 45, 45, 
182         45, 45, 45, 8, 45, 45, 10, 11, 
183         12, 13, 14, 15, 16, 17, 18, 45, 
184         2, 45, 46, 46, 45, 5, 45, 6, 
185         45, 45, 45, 45, 45, 45, 45, 53, 
186         45, 45, 45, 45, 45, 45, 14, 15, 
187         16, 17, 18, 45, 2, 45, 46, 46, 
188         45, 5, 45, 6, 45, 45, 45, 45, 
189         45, 45, 45, 45, 45, 45, 45, 45, 
190         45, 45, 14, 15, 16, 17, 18, 45, 
191         2, 45, 46, 46, 45, 5, 45, 6, 
192         45, 45, 45, 45, 45, 45, 45, 45, 
193         45, 45, 45, 45, 45, 45, 14, 15, 
194         16, 45, 18, 45, 2, 45, 46, 46, 
195         45, 5, 45, 6, 45, 45, 45, 45, 
196         45, 45, 45, 45, 45, 45, 45, 45, 
197         45, 45, 14, 45, 16, 45, 18, 45, 
198         2, 45, 46, 46, 45, 5, 45, 6, 
199         45, 45, 45, 45, 45, 45, 45, 45, 
200         45, 45, 45, 45, 45, 45, 14, 15, 
201         16, 17, 18, 53, 45, 2, 45, 46, 
202         46, 45, 5, 45, 6, 45, 45, 45, 
203         45, 45, 45, 45, 45, 45, 45, 10, 
204         45, 12, 45, 14, 15, 16, 17, 18, 
205         45, 2, 45, 46, 46, 45, 5, 45, 
206         6, 45, 45, 45, 45, 45, 45, 45, 
207         53, 45, 45, 10, 45, 45, 45, 14, 
208         15, 16, 17, 18, 45, 2, 45, 46, 
209         46, 45, 5, 45, 6, 45, 45, 45, 
210         45, 45, 45, 45, 54, 45, 45, 10, 
211         11, 12, 45, 14, 15, 16, 17, 18, 
212         45, 2, 45, 46, 46, 45, 5, 45, 
213         6, 45, 45, 45, 45, 45, 45, 45, 
214         45, 45, 45, 10, 11, 12, 45, 14, 
215         15, 16, 17, 18, 45, 2, 3, 46, 
216         46, 45, 5, 45, 6, 45, 45, 45, 
217         45, 45, 45, 45, 8, 45, 45, 10, 
218         11, 12, 13, 14, 15, 16, 17, 18, 
219         45, 22, 23, 24, 24, 21, 25, 21, 
220         26, 21, 21, 21, 21, 21, 21, 21, 
221         55, 21, 21, 28, 29, 30, 31, 32, 
222         33, 34, 35, 36, 37, 21, 22, 56, 
223         24, 24, 21, 25, 21, 26, 21, 21, 
224         21, 21, 21, 21, 21, 27, 21, 21, 
225         28, 29, 30, 31, 32, 33, 34, 35, 
226         36, 21, 1, 1, 2, 3, 46, 46, 
227         45, 5, 45, 6, 1, 45, 45, 45, 
228         45, 1, 45, 8, 45, 45, 10, 11, 
229         12, 13, 14, 15, 16, 17, 18, 19, 
230         45, 1, 45, 1, 1, 57, 57, 57, 
231         57, 57, 57, 57, 57, 1, 57, 57, 
232         57, 57, 1, 57, 57, 57, 57, 57, 
233         57, 57, 57, 57, 57, 57, 57, 57, 
234         57, 57, 1, 57, 58, 57, 0
235 };
236
237 static const char _myanmar_syllable_machine_trans_targs[] = {
238         0, 1, 24, 34, 0, 25, 31, 47, 
239         36, 50, 37, 42, 43, 44, 27, 39, 
240         40, 41, 30, 46, 51, 0, 2, 12, 
241         0, 3, 9, 13, 14, 19, 20, 21, 
242         5, 16, 17, 18, 8, 23, 4, 6, 
243         7, 10, 11, 15, 22, 0, 0, 26, 
244         28, 29, 32, 33, 35, 38, 45, 48, 
245         49, 0, 0
246 };
247
248 static const char _myanmar_syllable_machine_trans_actions[] = {
249         3, 0, 0, 0, 4, 0, 0, 0, 
250         0, 0, 0, 0, 0, 0, 0, 0, 
251         0, 0, 0, 0, 0, 5, 0, 0, 
252         6, 0, 0, 0, 0, 0, 0, 0, 
253         0, 0, 0, 0, 0, 0, 0, 0, 
254         0, 0, 0, 0, 0, 7, 8, 0, 
255         0, 0, 0, 0, 0, 0, 0, 0, 
256         0, 9, 10
257 };
258
259 static const char _myanmar_syllable_machine_to_state_actions[] = {
260         1, 0, 0, 0, 0, 0, 0, 0, 
261         0, 0, 0, 0, 0, 0, 0, 0, 
262         0, 0, 0, 0, 0, 0, 0, 0, 
263         0, 0, 0, 0, 0, 0, 0, 0, 
264         0, 0, 0, 0, 0, 0, 0, 0, 
265         0, 0, 0, 0, 0, 0, 0, 0, 
266         0, 0, 0, 0
267 };
268
269 static const char _myanmar_syllable_machine_from_state_actions[] = {
270         2, 0, 0, 0, 0, 0, 0, 0, 
271         0, 0, 0, 0, 0, 0, 0, 0, 
272         0, 0, 0, 0, 0, 0, 0, 0, 
273         0, 0, 0, 0, 0, 0, 0, 0, 
274         0, 0, 0, 0, 0, 0, 0, 0, 
275         0, 0, 0, 0, 0, 0, 0, 0, 
276         0, 0, 0, 0
277 };
278
279 static const short _myanmar_syllable_machine_eof_trans[] = {
280         0, 22, 22, 22, 22, 22, 22, 22, 
281         22, 22, 22, 22, 22, 22, 22, 22, 
282         22, 22, 22, 22, 22, 22, 22, 22, 
283         46, 46, 46, 46, 46, 46, 46, 46, 
284         46, 46, 46, 46, 46, 46, 46, 46, 
285         46, 46, 46, 46, 46, 46, 46, 22, 
286         22, 46, 58, 58
287 };
288
289 static const int myanmar_syllable_machine_start = 0;
290 static const int myanmar_syllable_machine_first_final = 0;
291 static const int myanmar_syllable_machine_error = -1;
292
293 static const int myanmar_syllable_machine_en_main = 0;
294
295
296 #line 36 "hb-ot-shape-complex-myanmar-machine.rl"
297
298
299
300 #line 94 "hb-ot-shape-complex-myanmar-machine.rl"
301
302
303 #define found_syllable(syllable_type) \
304   HB_STMT_START { \
305     if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \
306     for (unsigned int i = ts; i < te; i++) \
307       info[i].syllable() = (syllable_serial << 4) | myanmar_##syllable_type; \
308     syllable_serial++; \
309     if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
310   } HB_STMT_END
311
312 static void
313 find_syllables_myanmar (hb_buffer_t *buffer)
314 {
315   unsigned int p, pe, eof, ts, te, act HB_UNUSED;
316   int cs;
317   hb_glyph_info_t *info = buffer->info;
318   
319 #line 320 "hb-ot-shape-complex-myanmar-machine.hh"
320         {
321         cs = myanmar_syllable_machine_start;
322         ts = 0;
323         te = 0;
324         act = 0;
325         }
326
327 #line 114 "hb-ot-shape-complex-myanmar-machine.rl"
328
329
330   p = 0;
331   pe = eof = buffer->len;
332
333   unsigned int syllable_serial = 1;
334   
335 #line 336 "hb-ot-shape-complex-myanmar-machine.hh"
336         {
337         int _slen;
338         int _trans;
339         const unsigned char *_keys;
340         const char *_inds;
341         if ( p == pe )
342                 goto _test_eof;
343 _resume:
344         switch ( _myanmar_syllable_machine_from_state_actions[cs] ) {
345         case 2:
346 #line 1 "NONE"
347         {ts = p;}
348         break;
349 #line 350 "hb-ot-shape-complex-myanmar-machine.hh"
350         }
351
352         _keys = _myanmar_syllable_machine_trans_keys + (cs<<1);
353         _inds = _myanmar_syllable_machine_indicies + _myanmar_syllable_machine_index_offsets[cs];
354
355         _slen = _myanmar_syllable_machine_key_spans[cs];
356         _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].myanmar_category()) &&
357                 ( info[p].myanmar_category()) <= _keys[1] ?
358                 ( info[p].myanmar_category()) - _keys[0] : _slen ];
359
360 _eof_trans:
361         cs = _myanmar_syllable_machine_trans_targs[_trans];
362
363         if ( _myanmar_syllable_machine_trans_actions[_trans] == 0 )
364                 goto _again;
365
366         switch ( _myanmar_syllable_machine_trans_actions[_trans] ) {
367         case 6:
368 #line 86 "hb-ot-shape-complex-myanmar-machine.rl"
369         {te = p+1;{ found_syllable (consonant_syllable); }}
370         break;
371         case 4:
372 #line 87 "hb-ot-shape-complex-myanmar-machine.rl"
373         {te = p+1;{ found_syllable (non_myanmar_cluster); }}
374         break;
375         case 10:
376 #line 88 "hb-ot-shape-complex-myanmar-machine.rl"
377         {te = p+1;{ found_syllable (punctuation_cluster); }}
378         break;
379         case 8:
380 #line 89 "hb-ot-shape-complex-myanmar-machine.rl"
381         {te = p+1;{ found_syllable (broken_cluster); }}
382         break;
383         case 3:
384 #line 90 "hb-ot-shape-complex-myanmar-machine.rl"
385         {te = p+1;{ found_syllable (non_myanmar_cluster); }}
386         break;
387         case 5:
388 #line 86 "hb-ot-shape-complex-myanmar-machine.rl"
389         {te = p;p--;{ found_syllable (consonant_syllable); }}
390         break;
391         case 7:
392 #line 89 "hb-ot-shape-complex-myanmar-machine.rl"
393         {te = p;p--;{ found_syllable (broken_cluster); }}
394         break;
395         case 9:
396 #line 90 "hb-ot-shape-complex-myanmar-machine.rl"
397         {te = p;p--;{ found_syllable (non_myanmar_cluster); }}
398         break;
399 #line 400 "hb-ot-shape-complex-myanmar-machine.hh"
400         }
401
402 _again:
403         switch ( _myanmar_syllable_machine_to_state_actions[cs] ) {
404         case 1:
405 #line 1 "NONE"
406         {ts = 0;}
407         break;
408 #line 409 "hb-ot-shape-complex-myanmar-machine.hh"
409         }
410
411         if ( ++p != pe )
412                 goto _resume;
413         _test_eof: {}
414         if ( p == eof )
415         {
416         if ( _myanmar_syllable_machine_eof_trans[cs] > 0 ) {
417                 _trans = _myanmar_syllable_machine_eof_trans[cs] - 1;
418                 goto _eof_trans;
419         }
420         }
421
422         }
423
424 #line 122 "hb-ot-shape-complex-myanmar-machine.rl"
425
426 }
427
428 #undef found_syllable
429
430 #endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH */