Coverage Report

Created: 2026-07-20 07:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libfreehand/src/lib/tokenhash.h
Line
Count
Source
1
/* C++ code produced by gperf version 3.1 */
2
/* Command-line: gperf --compare-strncmp -C -m 20 tokens.gperf  */
3
/* Computed positions: -k'1,4-5,8' */
4
5
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6
      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
7
      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
8
      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
9
      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
10
      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
11
      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
12
      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
13
      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
14
      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
15
      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
16
      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
17
      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
18
      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
19
      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
20
      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
21
      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
22
      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
23
      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
24
      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
25
      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
26
      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
27
      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
28
/* The character set is not based on ISO-646.  */
29
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
30
#endif
31
32
#line 5 "tokens.gperf"
33
struct fhtoken
34
{
35
  const char *name;
36
  int tokenId;
37
};
38
39
#define TOTAL_KEYWORDS 124
40
513k
#define MIN_WORD_LENGTH 4
41
1.03M
#define MAX_WORD_LENGTH 24
42
#define MIN_HASH_VALUE 18
43
223k
#define MAX_HASH_VALUE 187
44
/* maximum key range = 170, duplicates = 0 */
45
46
class Perfect_Hash
47
{
48
private:
49
  static inline unsigned int hash (const char *str, size_t len);
50
public:
51
  static const struct fhtoken *in_word_set (const char *str, size_t len);
52
};
53
54
inline unsigned int
55
Perfect_Hash::hash (const char *str, size_t len)
56
223k
{
57
223k
  static const unsigned char asso_values[] =
58
223k
    {
59
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
60
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
61
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
62
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
63
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
64
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
65
223k
      188, 188, 188, 188, 188,  91,  12,  10,  57,  24,
66
223k
        6,  14,   5,  51, 188, 188,   9,   6,  49, 101,
67
223k
       37, 188,  81,  44,   5,   7,  31, 188,  17, 188,
68
223k
      188, 188, 188, 188, 188, 188, 188,   6,  12,  14,
69
223k
       94,   9,   5,  31,  50,   5,   5, 111,  24,  50,
70
223k
       54,  29,  12, 188,   6,  37,   5,  81,  39,  13,
71
223k
      188,  34, 188, 188, 188, 188, 188, 188, 188, 188,
72
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
73
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
74
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
75
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
76
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
77
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
78
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
79
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
80
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
81
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
82
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
83
223k
      188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
84
223k
      188, 188, 188, 188, 188, 188
85
223k
    };
86
223k
  unsigned int hval = len;
87
88
223k
  switch (hval)
89
223k
    {
90
126k
      default:
91
126k
        hval += asso_values[static_cast<unsigned char>(str[7])];
92
      /*FALLTHROUGH*/
93
150k
      case 7:
94
170k
      case 6:
95
204k
      case 5:
96
204k
        hval += asso_values[static_cast<unsigned char>(str[4])];
97
      /*FALLTHROUGH*/
98
223k
      case 4:
99
223k
        hval += asso_values[static_cast<unsigned char>(str[3])];
100
      /*FALLTHROUGH*/
101
223k
      case 3:
102
223k
      case 2:
103
223k
      case 1:
104
223k
        hval += asso_values[static_cast<unsigned char>(str[0])];
105
223k
        break;
106
223k
    }
107
223k
  return hval;
108
223k
}
109
110
static const struct fhtoken wordlist[] =
111
  {
112
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
113
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
114
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
115
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
116
    {(char*)0, 0}, {(char*)0, 0},
117
#line 70 "tokens.gperf"
118
    {"List",FH_LIST},
119
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
120
#line 119 "tokens.gperf"
121
    {"TString",FH_TSTRING},
122
#line 75 "tokens.gperf"
123
    {"MString",FH_MSTRING},
124
#line 131 "tokens.gperf"
125
    {"UString",FH_USTRING},
126
#line 117 "tokens.gperf"
127
    {"TEffect",FH_TEFFECT},
128
    {(char*)0, 0}, {(char*)0, 0},
129
#line 65 "tokens.gperf"
130
    {"Layer",FH_LAYER},
131
#line 71 "tokens.gperf"
132
    {"MDict",FH_MDICT},
133
    {(char*)0, 0},
134
#line 61 "tokens.gperf"
135
    {"Halftone",FH_HALFTONE},
136
#line 120 "tokens.gperf"
137
    {"TabTable",FH_TABTABLE},
138
    {(char*)0, 0},
139
#line 83 "tokens.gperf"
140
    {"MultiBlend",FH_MULTIBLEND},
141
#line 82 "tokens.gperf"
142
    {"MpObject",FH_MPOBJECT},
143
#line 121 "tokens.gperf"
144
    {"TaperedFill",FH_TAPEREDFILL},
145
#line 122 "tokens.gperf"
146
    {"TaperedFillX",FH_TAPEREDFILLX},
147
#line 69 "tokens.gperf"
148
    {"LinearFill",FH_LINEARFILL},
149
#line 74 "tokens.gperf"
150
    {"MQuickDict",FH_MQUICKDICT},
151
#line 32 "tokens.gperf"
152
    {"ContentFill",FH_CONTENTFILL},
153
#line 76 "tokens.gperf"
154
    {"MasterPageDocMan",FH_MASTERPAGEDOCMAN},
155
#line 77 "tokens.gperf"
156
    {"MasterPageElement",FH_MASTERPAGEELEMENT},
157
#line 25 "tokens.gperf"
158
    {"CharacterFill",FH_CHARACTERFILL},
159
#line 50 "tokens.gperf"
160
    {"FWFeatherFilter",FH_FWFEATHERFILTER},
161
#line 56 "tokens.gperf"
162
    {"FilterAttributeHolder",FH_FILTERATTRIBUTEHOLDER},
163
#line 80 "tokens.gperf"
164
    {"MasterPageSymbolClass",FH_MASTERPAGESYMBOLCLASS},
165
#line 78 "tokens.gperf"
166
    {"MasterPageLayerElement",FH_MASTERPAGELAYERELEMENT},
167
#line 79 "tokens.gperf"
168
    {"MasterPageLayerInstance",FH_MASTERPAGELAYERINSTANCE},
169
#line 81 "tokens.gperf"
170
    {"MasterPageSymbolInstance",FH_MASTERPAGESYMBOLINSTANCE},
171
#line 28 "tokens.gperf"
172
    {"Color6",FH_COLOR6},
173
#line 127 "tokens.gperf"
174
    {"TileFill",FH_TILEFILL},
175
#line 72 "tokens.gperf"
176
    {"MList",FH_MLIST},
177
#line 84 "tokens.gperf"
178
    {"MultiColorList",FH_MULTICOLORLIST},
179
#line 132 "tokens.gperf"
180
    {"VDict",FH_VDICT},
181
#line 68 "tokens.gperf"
182
    {"LineTable",FH_LINETABLE},
183
#line 30 "tokens.gperf"
184
    {"ConeFill",FH_CONEFILL},
185
#line 128 "tokens.gperf"
186
    {"TintColor",FH_TINTCOLOR},
187
#line 129 "tokens.gperf"
188
    {"TintColor6",FH_TINTCOLOR6},
189
#line 34 "tokens.gperf"
190
    {"CustomProc",FH_CUSTOMPROC},
191
#line 33 "tokens.gperf"
192
    {"ContourFill",FH_CONTOURFILL},
193
#line 67 "tokens.gperf"
194
    {"LinePat",FH_LINEPAT},
195
#line 24 "tokens.gperf"
196
    {"CalligraphicStroke",FH_CALLIGRAPHICSTROKE},
197
#line 15 "tokens.gperf"
198
    {"BasicFill",FH_BASICFILL},
199
#line 104 "tokens.gperf"
200
    {"PropLst",FH_PROPLST},
201
#line 47 "tokens.gperf"
202
    {"FHDocHeader",FH_FHDOCHEADER},
203
#line 35 "tokens.gperf"
204
    {"Data",FH_DATA},
205
#line 97 "tokens.gperf"
206
    {"PatternFill",FH_PATTERNFILL},
207
#line 29 "tokens.gperf"
208
    {"CompositePath",FH_COMPOSITEPATH},
209
#line 73 "tokens.gperf"
210
    {"MName",FH_MNAME},
211
#line 98 "tokens.gperf"
212
    {"PatternLine",FH_PATTERNLINE},
213
#line 90 "tokens.gperf"
214
    {"PSFill",FH_PSFILL},
215
#line 48 "tokens.gperf"
216
    {"FWBevelFilter",FH_FWBEVELFILTER},
217
#line 44 "tokens.gperf"
218
    {"Envelope",FH_ENVELOPE},
219
#line 102 "tokens.gperf"
220
    {"Procedure",FH_PROCEDURE},
221
#line 51 "tokens.gperf"
222
    {"FWGlowFilter",FH_FWGLOWFILTER},
223
#line 126 "tokens.gperf"
224
    {"TextInPath",FH_TEXTINPATH},
225
#line 134 "tokens.gperf"
226
    {"Xform",FH_XFORM},
227
#line 125 "tokens.gperf"
228
    {"TextEffs",FH_TEXTEFFS},
229
#line 109 "tokens.gperf"
230
    {"SketchFilter",FH_SKETCHFILTER},
231
#line 27 "tokens.gperf"
232
    {"Collector",FH_COLLECTOR},
233
#line 103 "tokens.gperf"
234
    {"ProcessColor",FH_PROCESSCOLOR},
235
#line 39 "tokens.gperf"
236
    {"DuetFilter",FH_DUETFILTER},
237
#line 66 "tokens.gperf"
238
    {"LensFill",FH_LENSFILL},
239
#line 36 "tokens.gperf"
240
    {"DataList",FH_DATALIST},
241
#line 53 "tokens.gperf"
242
    {"FWSharpenFilter",FH_FWSHARPENFILTER},
243
    {(char*)0, 0},
244
#line 37 "tokens.gperf"
245
    {"DateTime",FH_DATETIME},
246
#line 52 "tokens.gperf"
247
    {"FWShadowFilter",FH_FWSHADOWFILTER},
248
#line 43 "tokens.gperf"
249
    {"Element",FH_ELEMENT},
250
#line 94 "tokens.gperf"
251
    {"Path",FH_PATH},
252
#line 64 "tokens.gperf"
253
    {"Import",FH_IMPORT},
254
#line 92 "tokens.gperf"
255
    {"PantoneColor",FH_PANTONECOLOR},
256
#line 16 "tokens.gperf"
257
    {"BasicLine",FH_BASICLINE},
258
#line 93 "tokens.gperf"
259
    {"Paragraph",FH_PARAGRAPH},
260
#line 41 "tokens.gperf"
261
    {"ElemList",FH_ELEMLIST},
262
#line 110 "tokens.gperf"
263
    {"SpotColor",FH_SPOTCOLOR},
264
#line 111 "tokens.gperf"
265
    {"SpotColor6",FH_SPOTCOLOR6},
266
#line 54 "tokens.gperf"
267
    {"Figure",FH_FIGURE},
268
#line 55 "tokens.gperf"
269
    {"FileDescriptor",FH_FILEDESCRIPTOR},
270
#line 45 "tokens.gperf"
271
    {"ExpandFilter",FH_EXPANDFILTER},
272
#line 91 "tokens.gperf"
273
    {"PSLine",FH_PSLINE},
274
#line 116 "tokens.gperf"
275
    {"SymbolLibrary",FH_SYMBOLLIBRARY},
276
#line 20 "tokens.gperf"
277
    {"Brush",FH_BRUSH},
278
#line 95 "tokens.gperf"
279
    {"PathText",FH_PATHTEXT},
280
#line 100 "tokens.gperf"
281
    {"PerspectiveGrid",FH_PERSPECTIVEGRID},
282
#line 105 "tokens.gperf"
283
    {"RadialFill",FH_RADIALFILL},
284
#line 106 "tokens.gperf"
285
    {"RadialFillX",FH_RADIALFILLX},
286
#line 38 "tokens.gperf"
287
    {"DisplayText",FH_DISPLAYTEXT},
288
#line 99 "tokens.gperf"
289
    {"PerspectiveEnvelope",FH_PERSPECTIVEENVELOPE},
290
#line 124 "tokens.gperf"
291
    {"TextColumn",FH_TEXTCOLUMN},
292
#line 59 "tokens.gperf"
293
    {"Group",FH_GROUP},
294
#line 96 "tokens.gperf"
295
    {"PathTextLineInfo",FH_PATHTEXTLINEINFO},
296
#line 63 "tokens.gperf"
297
    {"ImageImport",FH_IMAGEIMPORT},
298
#line 31 "tokens.gperf"
299
    {"ConnectorLine",FH_CONNECTORLINE},
300
#line 22 "tokens.gperf"
301
    {"BrushStroke",FH_BRUSHSTROKE},
302
#line 130 "tokens.gperf"
303
    {"TransformFilter",FH_TRANSFORMFILTER},
304
#line 112 "tokens.gperf"
305
    {"StylePropLst",FH_STYLEPROPLST},
306
#line 23 "tokens.gperf"
307
    {"BrushTip",FH_BRUSHTIP},
308
#line 114 "tokens.gperf"
309
    {"SymbolClass",FH_SYMBOLCLASS},
310
#line 101 "tokens.gperf"
311
    {"PolygonFigure",FH_POLYGONFIGURE},
312
#line 14 "tokens.gperf"
313
    {"AttributeHolder",FH_ATTRIBUTEHOLDER},
314
#line 60 "tokens.gperf"
315
    {"Guides",FH_GUIDES},
316
#line 62 "tokens.gperf"
317
    {"ImageFill",FH_IMAGEFILL},
318
#line 108 "tokens.gperf"
319
    {"Rectangle",FH_RECTANGLE},
320
#line 26 "tokens.gperf"
321
    {"ClipGroup",FH_CLIPGROUP},
322
#line 17 "tokens.gperf"
323
    {"BendFilter",FH_BENDFILTER},
324
#line 49 "tokens.gperf"
325
    {"FWBlurFilter",FH_FWBLURFILTER},
326
#line 89 "tokens.gperf"
327
    {"Oval",FH_OVAL},
328
    {(char*)0, 0},
329
#line 86 "tokens.gperf"
330
    {"NewContourFill",FH_NEWCONTOURFILL},
331
#line 58 "tokens.gperf"
332
    {"GraphicStyle",FH_GRAPHICSTYLE},
333
#line 11 "tokens.gperf"
334
    {"AGDFont",FH_AGDFONT},
335
#line 42 "tokens.gperf"
336
    {"ElemPropLst",FH_ELEMPROPLST},
337
    {(char*)0, 0},
338
#line 57 "tokens.gperf"
339
    {"GradientMaskFilter",FH_GRADIENTMASKFILTER},
340
    {(char*)0, 0},
341
#line 107 "tokens.gperf"
342
    {"RaggedFilter",FH_RAGGEDFILTER},
343
#line 88 "tokens.gperf"
344
    {"OpacityFilter",FH_OPACITYFILTER},
345
#line 40 "tokens.gperf"
346
    {"EPSImport",FH_EPSIMPORT},
347
#line 123 "tokens.gperf"
348
    {"TextBlok",FH_TEXTBLOK},
349
#line 19 "tokens.gperf"
350
    {"Block",FH_BLOCK},
351
    {(char*)0, 0}, {(char*)0, 0},
352
#line 21 "tokens.gperf"
353
    {"BrushList",FH_BRUSHLIST},
354
    {(char*)0, 0},
355
#line 13 "tokens.gperf"
356
    {"ArrowPath",FH_ARROWPATH},
357
    {(char*)0, 0},
358
#line 46 "tokens.gperf"
359
    {"Extrusion",FH_EXTRUSION},
360
#line 133 "tokens.gperf"
361
    {"VMpObj",FH_VMPOBJ},
362
    {(char*)0, 0}, {(char*)0, 0},
363
#line 115 "tokens.gperf"
364
    {"SymbolInstance",FH_SYMBOLINSTANCE},
365
#line 118 "tokens.gperf"
366
    {"TFOnPath",FH_TFONPATH},
367
#line 87 "tokens.gperf"
368
    {"NewRadialFill",FH_NEWRADIALFILL},
369
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
370
#line 113 "tokens.gperf"
371
    {"SwfImport",FH_SWFIMPORT},
372
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
373
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
374
    {(char*)0, 0},
375
#line 12 "tokens.gperf"
376
    {"AGDSelection",FH_AGDSELECTION},
377
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
378
    {(char*)0, 0},
379
#line 18 "tokens.gperf"
380
    {"BlendObject",FH_BLENDOBJECT},
381
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
382
    {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
383
    {(char*)0, 0}, {(char*)0, 0},
384
#line 85 "tokens.gperf"
385
    {"NewBlend",FH_NEWBLEND}
386
  };
387
388
const struct fhtoken *
389
Perfect_Hash::in_word_set (const char *str, size_t len)
390
519k
{
391
519k
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
392
223k
    {
393
223k
      unsigned int key = hash (str, len);
394
395
223k
      if (key <= MAX_HASH_VALUE)
396
197k
        {
397
197k
          const char *s = wordlist[key].name;
398
399
197k
          if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
400
164k
            return &wordlist[key];
401
197k
        }
402
223k
    }
403
354k
  return 0;
404
519k
}
405
#line 135 "tokens.gperf"
406