Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/workdir/UnpackedTarball/harfbuzz/src/hb-ot-shaper-indic-table.cc
Line
Count
Source
1
/* == Start of generated table == */
2
/*
3
 * The following table is generated by running:
4
 *
5
 *   ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt
6
 *
7
 * on files with these headers:
8
 *
9
 * # IndicSyllabicCategory-17.0.0.txt
10
 * # Date: 2025-08-01, 04:02:23 GMT
11
 * # IndicPositionalCategory-17.0.0.txt
12
 * # Date: 2025-07-29, 13:35:52 GMT
13
 * # Blocks-17.0.0.txt
14
 * # Date: 2025-08-01
15
 */
16
17
#include "hb.hh"
18
19
#ifndef HB_NO_OT_SHAPE
20
21
#include "hb-ot-shaper-indic.hh"
22
23
#pragma GCC diagnostic push
24
#pragma GCC diagnostic ignored "-Wunused-macros"
25
26
#include "hb-ot-shaper-indic-machine.hh"
27
#include "hb-ot-shaper-khmer-machine.hh"
28
#include "hb-ot-shaper-myanmar-machine.hh"
29
30
/* indic */
31
#define OT_X I_Cat(X)
32
#define OT_C I_Cat(C)
33
#define OT_V I_Cat(V)
34
#define OT_N I_Cat(N)
35
#define OT_H I_Cat(H)
36
#define OT_ZWNJ I_Cat(ZWNJ)
37
#define OT_ZWJ I_Cat(ZWJ)
38
#define OT_M I_Cat(M)
39
#define OT_SM I_Cat(SM)
40
#define OT_A I_Cat(A)
41
#define OT_VD I_Cat(VD)
42
#define OT_PLACEHOLDER I_Cat(PLACEHOLDER)
43
#define OT_DOTTEDCIRCLE I_Cat(DOTTEDCIRCLE)
44
#define OT_RS I_Cat(RS)
45
#define OT_MPst I_Cat(MPst)
46
#define OT_Repha I_Cat(Repha)
47
#define OT_Ra I_Cat(Ra)
48
#define OT_CM I_Cat(CM)
49
#define OT_Symbol I_Cat(Symbol)
50
#define OT_CS I_Cat(CS)
51
#define OT_SMPst I_Cat(SMPst)
52
/* khmer */
53
#define OT_VAbv K_Cat(VAbv)
54
#define OT_VBlw K_Cat(VBlw)
55
#define OT_VPre K_Cat(VPre)
56
#define OT_VPst K_Cat(VPst)
57
#define OT_Robatic K_Cat(Robatic)
58
#define OT_Xgroup K_Cat(Xgroup)
59
#define OT_Ygroup K_Cat(Ygroup)
60
/* myanmar */
61
static_assert (OT_VAbv == M_Cat(VAbv), "");
62
static_assert (OT_VBlw == M_Cat(VBlw), "");
63
static_assert (OT_VPre == M_Cat(VPre), "");
64
static_assert (OT_VPst == M_Cat(VPst), "");
65
#define OT_IV M_Cat(IV)
66
#define OT_As M_Cat(As)
67
#define OT_DB M_Cat(DB)
68
#define OT_GB M_Cat(GB)
69
#define OT_MH M_Cat(MH)
70
#define OT_MR M_Cat(MR)
71
#define OT_MW M_Cat(MW)
72
#define OT_MY M_Cat(MY)
73
#define OT_PT M_Cat(PT)
74
#define OT_VS M_Cat(VS)
75
#define OT_ML M_Cat(ML)
76
77
78
#define _OT_A    OT_A            /*  53 chars; A */
79
#define _OT_As   OT_As           /*   1 chars; As */
80
#define _OT_C    OT_C            /* 478 chars; C */
81
#define _OT_CM   OT_CM           /*   1 chars; CM */
82
#define _OT_CS   OT_CS           /*   2 chars; CS */
83
#define _OT_DC   OT_DOTTEDCIRCLE /*   1 chars; DOTTEDCIRCLE */
84
#define _OT_H    OT_H            /*  11 chars; H */
85
#define _OT_M    OT_M            /* 142 chars; M */
86
#define _OT_MH   OT_MH           /*   1 chars; MH */
87
#define _OT_ML   OT_ML           /*   1 chars; ML */
88
#define _OT_MP   OT_MPst         /*   1 chars; MPst */
89
#define _OT_MR   OT_MR           /*   1 chars; MR */
90
#define _OT_MW   OT_MW           /*   2 chars; MW */
91
#define _OT_MY   OT_MY           /*   3 chars; MY */
92
#define _OT_N    OT_N            /*  17 chars; N */
93
#define _OT_GB   OT_PLACEHOLDER  /* 185 chars; PLACEHOLDER */
94
#define _OT_PT   OT_PT           /*   8 chars; PT */
95
#define _OT_R    OT_Ra           /*  14 chars; Ra */
96
#define _OT_Rf   OT_Repha        /*   1 chars; Repha */
97
#define _OT_Rt   OT_Robatic      /*   3 chars; Robatic */
98
#define _OT_SM   OT_SM           /*  50 chars; SM */
99
#define _OT_SP   OT_SMPst        /*   6 chars; SMPst */
100
#define _OT_S    OT_Symbol       /*  22 chars; Symbol */
101
#define _OT_V    OT_V            /* 172 chars; V */
102
#define _OT_VA   OT_VAbv         /*  18 chars; VAbv */
103
#define _OT_VB   OT_VBlw         /*   7 chars; VBlw */
104
#define _OT_VL   OT_VPre         /*   5 chars; VPre */
105
#define _OT_VR   OT_VPst         /*  13 chars; VPst */
106
#define _OT_VS   OT_VS           /*  16 chars; VS */
107
#define _OT_X    OT_X            /*   2 chars; X */
108
#define _OT_Xg   OT_Xgroup       /*   7 chars; Xgroup */
109
#define _OT_Yg   OT_Ygroup       /*   4 chars; Ygroup */
110
#define _OT_ZWJ  OT_ZWJ          /*   1 chars; ZWJ */
111
#define _OT_ZWNJ OT_ZWNJ         /*   1 chars; ZWNJ */
112
113
#define _POS_T   POS_ABOVE_C     /*  22 chars; ABOVE_C */
114
#define _POS_A   POS_AFTER_MAIN  /*   3 chars; AFTER_MAIN */
115
#define _POS_AP  POS_AFTER_POST  /*  50 chars; AFTER_POST */
116
#define _POS_AS  POS_AFTER_SUB   /*  51 chars; AFTER_SUB */
117
#define _POS_C   POS_BASE_C      /* 853 chars; BASE_C */
118
#define _POS_BS  POS_BEFORE_SUB  /*  25 chars; BEFORE_SUB */
119
#define _POS_B   POS_BELOW_C     /*  13 chars; BELOW_C */
120
#define _POS_X   POS_END         /*  71 chars; END */
121
#define _POS_R   POS_POST_C      /*  13 chars; POST_C */
122
#define _POS_L   POS_PRE_C       /*   5 chars; PRE_C */
123
#define _POS_LM  POS_PRE_M       /*  14 chars; PRE_M */
124
#define _POS_SM  POS_SMVD        /* 130 chars; SMVD */
125
126
#pragma GCC diagnostic pop
127
128
#define INDIC_COMBINE_CATEGORIES(S,M) ((S) | ((M) << 8))
129
130
#define _(S,M) INDIC_COMBINE_CATEGORIES (_OT_##S, _POS_##M)
131
132
133
#include <stdint.h>
134
135
static const uint16_t _hb_indic_values[42]=
136
{
137
    _(A,SM),  _(As,X),   _(C,C),  _(CM,C),  _(CS,C),  _(DC,C),  _(GB,C),   _(H,B),
138
     _(H,T),   _(H,X),   _(M,A),  _(M,AP),  _(M,AS),   _(M,B),  _(M,BS),  _(M,LM),
139
    _(MH,X),  _(ML,X), _(MP,AP),  _(MR,X),  _(MW,X),  _(MY,X),   _(N,X),  _(PT,X),
140
     _(R,C),  _(Rf,X),  _(Rt,X),  _(S,SM), _(SM,BS), _(SM,SM), _(SP,SM),   _(V,C),
141
    _(VA,T),  _(VB,B),  _(VL,L),  _(VR,R),  _(VS,X),   _(X,X),  _(Xg,X),  _(Yg,X),
142
   _(ZWJ,X),_(ZWNJ,X),
143
};
144
static const uint8_t _hb_indic_u8[1220]=
145
{
146
    1,  0, 50,  4,  5, 96,  0,  7,  8,  9,  0,  0,  0,  0,  0,  0,
147
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
148
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,186,  0,  0,  0,  0,  0,
149
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,192,
150
    0,  0,  0,  0,208,224,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,
151
    2,  3,  0,  0,  0,  0,  0,  0,  0,  0,  4,  5,  6,  7,  8,  9,
152
   10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,  0,  0, 22, 23,
153
   24,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 25, 26,  0,  0,
154
    0, 27,  0,  0,  0,  0, 28, 29, 30,  0,  0,  0,  0,  0,  0,  0,
155
    0,  0,  0,  0,  0, 31,  0,  0,  0, 32,  0,  0,  0, 33,  0, 34,
156
    0,  0,  0,  0,  0,  0, 35,  0,  0,  0,  0,  0,  0,  0,  0,  0,
157
    0,  0, 36,  0,  0,  0,  0,  0,  0, 37,  0,  0,  0,  0,  0,  0,
158
    0,  0,  0,  0,  0,  0,  0, 25,  2, 10,  0,  0,  0,  0, 26,  0,
159
   27,  0,  0,  0, 28,  0,  0,  0,  0,  0, 29, 11, 30,  1,  1,  1,
160
    4, 31, 32, 33, 34,  1,  6,  2, 35,  1, 12, 13,  7,  1,  1,  3,
161
   36, 14, 15, 37, 16, 17,  6,  2, 38, 39, 18, 40,  7,  1,  1,  3,
162
   41, 42, 43, 44, 45, 46, 19,  2, 47,  0, 18, 48, 49,  1,  1,  3,
163
   20, 14, 50, 51,  0,  0, 21,  2,  0, 52, 53, 13,  7,  1,  1,  3,
164
   20, 54, 15, 55, 56, 17,  6,  2, 57,  0, 58, 59, 60, 61, 62, 63,
165
    4, 64, 65, 66, 16,  0, 19,  2,  0,  0, 67,  8,  9,  1,  1,  3,
166
    4, 22, 68, 69, 70, 71, 23,  2,  0,  0, 12,  8,  9,  1,  1,  3,
167
   72, 22, 73, 74, 75, 76, 23,  2, 77,  0, 78,  8,  9,  1,  1,  1,
168
    4, 79, 80, 81, 82, 83, 21,  2,  0, 84, 85,  1,  1, 86, 87, 88,
169
   89, 90,  2, 91, 92, 93, 94, 95, 96,  1, 97, 98,  2, 99,  0,  0,
170
    0,  0,  1,  1,  1,100,101, 11,102,103,104,105,106,107,  2, 10,
171
    0,  0,  0,  0,108,  5,  5,109,110,111,  0,112,113,  0,114,  0,
172
    0,  0,  0,  0,  0,  0,  0,  0,115,  0,116,  0,  0,  0,  0,  0,
173
    0,  0,  0,117,  0,  0,  0,  0,  0,118,  0,  0,  0,  0,  5,  5,
174
  119,120,  0,  0,  0,  0,121,  1,  2,122,  0,  0,  0,  0,  1,  1,
175
  123,124, 24, 24,  0,  0,  0,  0,  0,  0,125,  0,  0,  0,  0,  0,
176
    0,126,  0,  0,  2,  2,  2, 10,  0,  0,  0,  0,  2,  2,  2,  2,
177
    4,  4,  4,  4, 10,  2,  2,  2, 26,  2,  2,  2,  8,  8,  8,  8,
178
    6, 18,  0,  4, 20, 14, 24,  2,  6,  6, 20,  6, 20,  6, 24,  2,
179
    4,  0,  0,  0,  6,  6,  6,  6, 66, 12, 14,  6,  6,  6, 20, 14,
180
    2,  0, 36, 50, 52, 18, 38, 68,  0,  0,  0, 32,  0,  0,  2, 16,
181
   56, 12, 14,  6,  0,  0,  0,  4, 44,  2, 16,  2,  6, 22,  0,  4,
182
    2,  0, 36, 28,  6, 28,  0,  4, 30, 30, 30, 30,  0,  0, 42,  0,
183
   34,  0,  0,  0,  0, 64,  0,  0,  0,  0,  0, 42, 12, 12,  6,  6,
184
    6,  6, 24,  2,  2, 18, 36,112, 18, 18, 18, 18, 18, 18,114,116,
185
  118,120,122, 18,  0,  6,  6,  6, 44, 10,  0,  2, 54, 32, 46, 10,
186
   26,  0,  0,  0,  0,  0, 34, 70,  6, 20,  0, 14, 44,  2, 16, 10,
187
    2,  0, 72, 50,124, 48,  0, 32, 48, 32, 46,  0,126,  0,  0,  0,
188
   16,  2, 10, 10, 12,  2,128,  0,  6,  6,  6, 14,  6, 14, 24,  2,
189
   22, 22, 52, 74, 76, 32, 46,  0, 16, 58, 58, 78,130, 12, 14,  6,
190
    2,  0, 36,132,134, 32, 46,  0,  0,  0, 80,136, 16,  0,  0,  0,
191
    0, 70, 14,  6,  6, 20,  0,  6, 20,  6, 24,  0, 16, 10, 10,  2,
192
    0, 16, 10,  0,  2, 10,  0,  2,  2,  0,  0, 22, 76, 48,  0, 82,
193
   54, 22, 84,  0, 12, 12,138,  6, 28, 60, 38, 28, 86, 28, 88,  0,
194
    0,  0,140, 86,  2, 10, 16,  0, 26,  2, 16,  2, 28, 60, 38, 60,
195
   38, 18, 88,  0,  0,  0, 74, 38,  0,  0, 16, 10,142,144,  0,  0,
196
   12, 12,146,  6,  2,148,150, 22, 22, 22, 48, 82, 54, 22, 84,152,
197
    0,  0,  2,154,  0,  0,  0, 14,  0,  2,  2,  2,  2,  2, 26,  2,
198
    2,156,  2,  2, 90,  6,  6,  6,  6,158, 92, 94,160,162, 62, 58,
199
  164,166,168,170,  4,  4,  0, 10,  2,  6,  6, 96, 98, 26,  2,172,
200
  174,100,176,178,100,102,102,  2,104, 62,180,  2,  2,182,184,186,
201
   12, 12, 12,188,  4, 12,190,  0,  2, 26,  2,  2,  2, 90,  6,  6,
202
    6,  6,  0, 92, 62, 94, 98,192,194,196, 96,198,200,106,106,108,
203
  108,202,  0,  0, 42,  0,204,  0,  8,206,  8,  8,208, 40,210, 40,
204
   40,  2,212,214,  8, 34,  0,  0,  0,  0,216,  0,  4,  4,  4,  0,
205
    0, 34,  0,  0,  0,  0,110,  0,  0, 64,110,  0,  0,  0,218,  0,
206
    0, 42,  4, 34,  8, 40, 40, 40,  0,  0,  0,220,  2,  2,104, 16,
207
    4,  2,  2, 10, 16,  2,  4, 34,  0,222, 78,  2, 56, 12,  0,  0,
208
    0, 80, 72,  0, 37, 37,  2,  2,  6,  6, 31, 31,  0,  0,  2, 37,
209
   29, 29, 37, 31, 37,  2, 12, 12, 31, 37, 11, 11, 31,  2, 24,  2,
210
   14, 14, 36, 36, 37, 11,  6, 37, 22, 27, 12, 37, 27, 27, 37,  6,
211
   24, 37, 11,  7, 11, 37, 11, 15, 11, 12, 15, 37, 37, 29,  0, 22,
212
   14, 12, 32, 32, 30, 30,  6, 29, 37, 15, 29, 37, 22, 37, 37, 12,
213
   12, 11, 22, 22, 37, 22, 15, 15, 11,  8, 14, 37, 14,  8,  2, 31,
214
   35, 32, 32, 33, 35, 35, 33, 33, 35, 23, 23, 23,  2, 32, 26, 38,
215
   38, 38, 30, 37, 12, 15, 12,  7, 15, 12, 37,  0,  0, 29, 29, 12,
216
   18, 11, 37, 13, 37,  3, 37, 28, 11, 10, 10, 37, 10, 11, 29, 31,
217
   37, 14, 37,  4,  4, 29,  6, 31,  2, 12, 12, 27, 25, 37,  2, 11,
218
    2, 24, 31, 35, 33, 34,  0, 32, 29,  9,  1, 21, 19, 20, 16,  2,
219
   21, 21, 17,  2, 23,  2,  2, 35, 32,  2, 20, 35, 34, 32, 32, 29,
220
    2, 29, 29, 32, 32, 35, 35, 34, 34, 34, 38, 39, 39, 26,  9, 39,
221
   27, 39,  0, 37,  0, 27, 27,  0,  0,  2,  2,  0, 41, 40,  5, 37,
222
   31, 12,  2, 23,
223
};
224
225
static inline uint8_t _hb_indic_b4 (const uint8_t* a, unsigned i)
226
2.11M
{
227
2.11M
  return (a[i>>1]>>((i&1)<<2))&15;
228
2.11M
}
229
static inline uint8_t _hb_indic_get_categories_index (unsigned u)
230
2.12M
{
231
  /* packtab: [2^4,2^3,2^3,2^2,2^1] */
232
2.12M
  return u<71396u ? (uint8_t)(_hb_indic_u8[996u+_hb_indic_u8[488u+((_hb_indic_u8[186u+((_hb_indic_u8[70u+((_hb_indic_b4(_hb_indic_u8,((((((((u)>>1))>>2))>>3))>>3)))<<3)+((((((((u)>>1))>>2))>>3))&7)])<<3)+((((((u)>>1))>>2))&7)])<<2)+((((u)>>1))&3)]+((u)&1)]) : 37;
233
2.12M
}
234
235
uint16_t
236
hb_indic_get_categories (hb_codepoint_t u)
237
2.12M
{
238
2.12M
  return _hb_indic_values[_hb_indic_get_categories_index (u)];
239
2.12M
}
240
241
#undef _
242
#undef INDIC_COMBINE_CATEGORIES
243
244
#undef _OT_A
245
#undef _OT_As
246
#undef _OT_C
247
#undef _OT_CM
248
#undef _OT_CS
249
#undef _OT_DC
250
#undef _OT_H
251
#undef _OT_M
252
#undef _OT_MH
253
#undef _OT_ML
254
#undef _OT_MP
255
#undef _OT_MR
256
#undef _OT_MW
257
#undef _OT_MY
258
#undef _OT_N
259
#undef _OT_GB
260
#undef _OT_PT
261
#undef _OT_R
262
#undef _OT_Rf
263
#undef _OT_Rt
264
#undef _OT_SM
265
#undef _OT_SP
266
#undef _OT_S
267
#undef _OT_V
268
#undef _OT_VA
269
#undef _OT_VB
270
#undef _OT_VL
271
#undef _OT_VR
272
#undef _OT_VS
273
#undef _OT_X
274
#undef _OT_Xg
275
#undef _OT_Yg
276
#undef _OT_ZWJ
277
#undef _OT_ZWNJ
278
279
#undef _POS_T
280
#undef _POS_A
281
#undef _POS_AP
282
#undef _POS_AS
283
#undef _POS_C
284
#undef _POS_BS
285
#undef _POS_B
286
#undef _POS_X
287
#undef _POS_R
288
#undef _POS_L
289
#undef _POS_LM
290
#undef _POS_SM
291
292
#endif
293
294
/* == End of generated table == */