Coverage Report

Created: 2026-11-10 14:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
src/tokens.c
Line
Count
Source
1
/*----------------------------------------------------------------------------*/
2
/* This file is generated by the templates/template.rb script and should not  */
3
/* be modified manually. See                                                  */
4
/* templates/src/tokens.c.erb                                                 */
5
/* if you are looking to modify the                                           */
6
/* template                                                                   */
7
/*----------------------------------------------------------------------------*/
8
9
#include "prism/ast.h"
10
11
#include "prism/internal/assert.h"
12
13
/**
14
 * Returns a string representation of the given token type.
15
 */
16
const char *
17
pm_token_type(pm_token_type_t token_type) {
18
    switch (token_type) {
19
        case PM_TOKEN_EOF:
20
            return "EOF";
21
        case PM_TOKEN_BRACE_RIGHT:
22
            return "BRACE_RIGHT";
23
        case PM_TOKEN_COMMA:
24
            return "COMMA";
25
        case PM_TOKEN_EMBEXPR_END:
26
            return "EMBEXPR_END";
27
        case PM_TOKEN_KEYWORD_DO:
28
            return "KEYWORD_DO";
29
        case PM_TOKEN_KEYWORD_ELSE:
30
            return "KEYWORD_ELSE";
31
        case PM_TOKEN_KEYWORD_ELSIF:
32
            return "KEYWORD_ELSIF";
33
        case PM_TOKEN_KEYWORD_END:
34
            return "KEYWORD_END";
35
        case PM_TOKEN_KEYWORD_ENSURE:
36
            return "KEYWORD_ENSURE";
37
        case PM_TOKEN_KEYWORD_IN:
38
            return "KEYWORD_IN";
39
        case PM_TOKEN_KEYWORD_RESCUE:
40
            return "KEYWORD_RESCUE";
41
        case PM_TOKEN_KEYWORD_THEN:
42
            return "KEYWORD_THEN";
43
        case PM_TOKEN_KEYWORD_WHEN:
44
            return "KEYWORD_WHEN";
45
        case PM_TOKEN_NEWLINE:
46
            return "NEWLINE";
47
        case PM_TOKEN_NEWLINE_TERMINATOR:
48
            return "NEWLINE_TERMINATOR";
49
        case PM_TOKEN_PARENTHESIS_RIGHT:
50
            return "PARENTHESIS_RIGHT";
51
        case PM_TOKEN_PIPE:
52
            return "PIPE";
53
        case PM_TOKEN_SEMICOLON:
54
            return "SEMICOLON";
55
        case PM_TOKEN_AMPERSAND:
56
            return "AMPERSAND";
57
        case PM_TOKEN_AMPERSAND_AMPERSAND:
58
            return "AMPERSAND_AMPERSAND";
59
        case PM_TOKEN_AMPERSAND_AMPERSAND_EQUAL:
60
            return "AMPERSAND_AMPERSAND_EQUAL";
61
        case PM_TOKEN_AMPERSAND_DOT:
62
            return "AMPERSAND_DOT";
63
        case PM_TOKEN_AMPERSAND_EQUAL:
64
            return "AMPERSAND_EQUAL";
65
        case PM_TOKEN_BACKTICK:
66
            return "BACKTICK";
67
        case PM_TOKEN_BACK_REFERENCE:
68
            return "BACK_REFERENCE";
69
        case PM_TOKEN_BANG:
70
            return "BANG";
71
        case PM_TOKEN_BANG_EQUAL:
72
            return "BANG_EQUAL";
73
        case PM_TOKEN_BANG_TILDE:
74
            return "BANG_TILDE";
75
        case PM_TOKEN_BRACE_LEFT:
76
            return "BRACE_LEFT";
77
        case PM_TOKEN_BRACE_LEFT_ARGUMENT:
78
            return "BRACE_LEFT_ARGUMENT";
79
        case PM_TOKEN_BRACE_LEFT_HASH:
80
            return "BRACE_LEFT_HASH";
81
        case PM_TOKEN_BRACKET_LEFT:
82
            return "BRACKET_LEFT";
83
        case PM_TOKEN_BRACKET_LEFT_ARRAY:
84
            return "BRACKET_LEFT_ARRAY";
85
        case PM_TOKEN_BRACKET_LEFT_RIGHT:
86
            return "BRACKET_LEFT_RIGHT";
87
        case PM_TOKEN_BRACKET_LEFT_RIGHT_EQUAL:
88
            return "BRACKET_LEFT_RIGHT_EQUAL";
89
        case PM_TOKEN_BRACKET_RIGHT:
90
            return "BRACKET_RIGHT";
91
        case PM_TOKEN_CARET:
92
            return "CARET";
93
        case PM_TOKEN_CARET_EQUAL:
94
            return "CARET_EQUAL";
95
        case PM_TOKEN_CHARACTER_LITERAL:
96
            return "CHARACTER_LITERAL";
97
        case PM_TOKEN_CLASS_VARIABLE:
98
            return "CLASS_VARIABLE";
99
        case PM_TOKEN_COLON:
100
            return "COLON";
101
        case PM_TOKEN_COLON_COLON:
102
            return "COLON_COLON";
103
        case PM_TOKEN_COMMENT:
104
            return "COMMENT";
105
        case PM_TOKEN_CONSTANT:
106
            return "CONSTANT";
107
        case PM_TOKEN_DOT:
108
            return "DOT";
109
        case PM_TOKEN_DOT_DOT:
110
            return "DOT_DOT";
111
        case PM_TOKEN_DOT_DOT_DOT:
112
            return "DOT_DOT_DOT";
113
        case PM_TOKEN_EMBDOC_BEGIN:
114
            return "EMBDOC_BEGIN";
115
        case PM_TOKEN_EMBDOC_END:
116
            return "EMBDOC_END";
117
        case PM_TOKEN_EMBDOC_LINE:
118
            return "EMBDOC_LINE";
119
        case PM_TOKEN_EMBEXPR_BEGIN:
120
            return "EMBEXPR_BEGIN";
121
        case PM_TOKEN_EMBVAR:
122
            return "EMBVAR";
123
        case PM_TOKEN_EQUAL:
124
            return "EQUAL";
125
        case PM_TOKEN_EQUAL_EQUAL:
126
            return "EQUAL_EQUAL";
127
        case PM_TOKEN_EQUAL_EQUAL_EQUAL:
128
            return "EQUAL_EQUAL_EQUAL";
129
        case PM_TOKEN_EQUAL_GREATER:
130
            return "EQUAL_GREATER";
131
        case PM_TOKEN_EQUAL_TILDE:
132
            return "EQUAL_TILDE";
133
        case PM_TOKEN_FLOAT:
134
            return "FLOAT";
135
        case PM_TOKEN_FLOAT_IMAGINARY:
136
            return "FLOAT_IMAGINARY";
137
        case PM_TOKEN_FLOAT_RATIONAL:
138
            return "FLOAT_RATIONAL";
139
        case PM_TOKEN_FLOAT_RATIONAL_IMAGINARY:
140
            return "FLOAT_RATIONAL_IMAGINARY";
141
        case PM_TOKEN_GLOBAL_VARIABLE:
142
            return "GLOBAL_VARIABLE";
143
        case PM_TOKEN_GREATER:
144
            return "GREATER";
145
        case PM_TOKEN_GREATER_EQUAL:
146
            return "GREATER_EQUAL";
147
        case PM_TOKEN_GREATER_GREATER:
148
            return "GREATER_GREATER";
149
        case PM_TOKEN_GREATER_GREATER_EQUAL:
150
            return "GREATER_GREATER_EQUAL";
151
        case PM_TOKEN_HEREDOC_END:
152
            return "HEREDOC_END";
153
        case PM_TOKEN_HEREDOC_START:
154
            return "HEREDOC_START";
155
        case PM_TOKEN_IDENTIFIER:
156
            return "IDENTIFIER";
157
        case PM_TOKEN_IGNORED_NEWLINE:
158
            return "IGNORED_NEWLINE";
159
        case PM_TOKEN_INSTANCE_VARIABLE:
160
            return "INSTANCE_VARIABLE";
161
        case PM_TOKEN_INTEGER:
162
            return "INTEGER";
163
        case PM_TOKEN_INTEGER_IMAGINARY:
164
            return "INTEGER_IMAGINARY";
165
        case PM_TOKEN_INTEGER_RATIONAL:
166
            return "INTEGER_RATIONAL";
167
        case PM_TOKEN_INTEGER_RATIONAL_IMAGINARY:
168
            return "INTEGER_RATIONAL_IMAGINARY";
169
        case PM_TOKEN_KEYWORD_ALIAS:
170
            return "KEYWORD_ALIAS";
171
        case PM_TOKEN_KEYWORD_AND:
172
            return "KEYWORD_AND";
173
        case PM_TOKEN_KEYWORD_BEGIN:
174
            return "KEYWORD_BEGIN";
175
        case PM_TOKEN_KEYWORD_BEGIN_UPCASE:
176
            return "KEYWORD_BEGIN_UPCASE";
177
        case PM_TOKEN_KEYWORD_BREAK:
178
            return "KEYWORD_BREAK";
179
        case PM_TOKEN_KEYWORD_CASE:
180
            return "KEYWORD_CASE";
181
        case PM_TOKEN_KEYWORD_CLASS:
182
            return "KEYWORD_CLASS";
183
        case PM_TOKEN_KEYWORD_DEF:
184
            return "KEYWORD_DEF";
185
        case PM_TOKEN_KEYWORD_DEFINED:
186
            return "KEYWORD_DEFINED";
187
        case PM_TOKEN_KEYWORD_DO_BLOCK:
188
            return "KEYWORD_DO_BLOCK";
189
        case PM_TOKEN_KEYWORD_DO_LAMBDA:
190
            return "KEYWORD_DO_LAMBDA";
191
        case PM_TOKEN_KEYWORD_DO_LOOP:
192
            return "KEYWORD_DO_LOOP";
193
        case PM_TOKEN_KEYWORD_END_UPCASE:
194
            return "KEYWORD_END_UPCASE";
195
        case PM_TOKEN_KEYWORD_FALSE:
196
            return "KEYWORD_FALSE";
197
        case PM_TOKEN_KEYWORD_FOR:
198
            return "KEYWORD_FOR";
199
        case PM_TOKEN_KEYWORD_IF:
200
            return "KEYWORD_IF";
201
        case PM_TOKEN_KEYWORD_IF_MODIFIER:
202
            return "KEYWORD_IF_MODIFIER";
203
        case PM_TOKEN_KEYWORD_MODULE:
204
            return "KEYWORD_MODULE";
205
        case PM_TOKEN_KEYWORD_NEXT:
206
            return "KEYWORD_NEXT";
207
        case PM_TOKEN_KEYWORD_NIL:
208
            return "KEYWORD_NIL";
209
        case PM_TOKEN_KEYWORD_NOT:
210
            return "KEYWORD_NOT";
211
        case PM_TOKEN_KEYWORD_OR:
212
            return "KEYWORD_OR";
213
        case PM_TOKEN_KEYWORD_REDO:
214
            return "KEYWORD_REDO";
215
        case PM_TOKEN_KEYWORD_RESCUE_MODIFIER:
216
            return "KEYWORD_RESCUE_MODIFIER";
217
        case PM_TOKEN_KEYWORD_RETRY:
218
            return "KEYWORD_RETRY";
219
        case PM_TOKEN_KEYWORD_RETURN:
220
            return "KEYWORD_RETURN";
221
        case PM_TOKEN_KEYWORD_SELF:
222
            return "KEYWORD_SELF";
223
        case PM_TOKEN_KEYWORD_SUPER:
224
            return "KEYWORD_SUPER";
225
        case PM_TOKEN_KEYWORD_TRUE:
226
            return "KEYWORD_TRUE";
227
        case PM_TOKEN_KEYWORD_UNDEF:
228
            return "KEYWORD_UNDEF";
229
        case PM_TOKEN_KEYWORD_UNLESS:
230
            return "KEYWORD_UNLESS";
231
        case PM_TOKEN_KEYWORD_UNLESS_MODIFIER:
232
            return "KEYWORD_UNLESS_MODIFIER";
233
        case PM_TOKEN_KEYWORD_UNTIL:
234
            return "KEYWORD_UNTIL";
235
        case PM_TOKEN_KEYWORD_UNTIL_MODIFIER:
236
            return "KEYWORD_UNTIL_MODIFIER";
237
        case PM_TOKEN_KEYWORD_WHILE:
238
            return "KEYWORD_WHILE";
239
        case PM_TOKEN_KEYWORD_WHILE_MODIFIER:
240
            return "KEYWORD_WHILE_MODIFIER";
241
        case PM_TOKEN_KEYWORD_YIELD:
242
            return "KEYWORD_YIELD";
243
        case PM_TOKEN_KEYWORD___ENCODING__:
244
            return "KEYWORD___ENCODING__";
245
        case PM_TOKEN_KEYWORD___FILE__:
246
            return "KEYWORD___FILE__";
247
        case PM_TOKEN_KEYWORD___LINE__:
248
            return "KEYWORD___LINE__";
249
        case PM_TOKEN_LABEL:
250
            return "LABEL";
251
        case PM_TOKEN_LABEL_END:
252
            return "LABEL_END";
253
        case PM_TOKEN_LAMBDA_BEGIN:
254
            return "LAMBDA_BEGIN";
255
        case PM_TOKEN_LESS:
256
            return "LESS";
257
        case PM_TOKEN_LESS_EQUAL:
258
            return "LESS_EQUAL";
259
        case PM_TOKEN_LESS_EQUAL_GREATER:
260
            return "LESS_EQUAL_GREATER";
261
        case PM_TOKEN_LESS_LESS:
262
            return "LESS_LESS";
263
        case PM_TOKEN_LESS_LESS_EQUAL:
264
            return "LESS_LESS_EQUAL";
265
        case PM_TOKEN_METHOD_NAME:
266
            return "METHOD_NAME";
267
        case PM_TOKEN_MINUS:
268
            return "MINUS";
269
        case PM_TOKEN_MINUS_EQUAL:
270
            return "MINUS_EQUAL";
271
        case PM_TOKEN_MINUS_GREATER:
272
            return "MINUS_GREATER";
273
        case PM_TOKEN_NUMBERED_REFERENCE:
274
            return "NUMBERED_REFERENCE";
275
        case PM_TOKEN_PARENTHESIS_LEFT:
276
            return "PARENTHESIS_LEFT";
277
        case PM_TOKEN_PARENTHESIS_LEFT_GROUPING:
278
            return "PARENTHESIS_LEFT_GROUPING";
279
        case PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES:
280
            return "PARENTHESIS_LEFT_PARENTHESES";
281
        case PM_TOKEN_PERCENT:
282
            return "PERCENT";
283
        case PM_TOKEN_PERCENT_EQUAL:
284
            return "PERCENT_EQUAL";
285
        case PM_TOKEN_PERCENT_LOWER_I:
286
            return "PERCENT_LOWER_I";
287
        case PM_TOKEN_PERCENT_LOWER_W:
288
            return "PERCENT_LOWER_W";
289
        case PM_TOKEN_PERCENT_LOWER_X:
290
            return "PERCENT_LOWER_X";
291
        case PM_TOKEN_PERCENT_UPPER_I:
292
            return "PERCENT_UPPER_I";
293
        case PM_TOKEN_PERCENT_UPPER_W:
294
            return "PERCENT_UPPER_W";
295
        case PM_TOKEN_PIPE_EQUAL:
296
            return "PIPE_EQUAL";
297
        case PM_TOKEN_PIPE_PIPE:
298
            return "PIPE_PIPE";
299
        case PM_TOKEN_PIPE_PIPE_EQUAL:
300
            return "PIPE_PIPE_EQUAL";
301
        case PM_TOKEN_PLUS:
302
            return "PLUS";
303
        case PM_TOKEN_PLUS_EQUAL:
304
            return "PLUS_EQUAL";
305
        case PM_TOKEN_QUESTION_MARK:
306
            return "QUESTION_MARK";
307
        case PM_TOKEN_REGEXP_BEGIN:
308
            return "REGEXP_BEGIN";
309
        case PM_TOKEN_REGEXP_END:
310
            return "REGEXP_END";
311
        case PM_TOKEN_SLASH:
312
            return "SLASH";
313
        case PM_TOKEN_SLASH_EQUAL:
314
            return "SLASH_EQUAL";
315
        case PM_TOKEN_STAR:
316
            return "STAR";
317
        case PM_TOKEN_STAR_EQUAL:
318
            return "STAR_EQUAL";
319
        case PM_TOKEN_STAR_STAR:
320
            return "STAR_STAR";
321
        case PM_TOKEN_STAR_STAR_EQUAL:
322
            return "STAR_STAR_EQUAL";
323
        case PM_TOKEN_STRING_BEGIN:
324
            return "STRING_BEGIN";
325
        case PM_TOKEN_STRING_CONTENT:
326
            return "STRING_CONTENT";
327
        case PM_TOKEN_STRING_END:
328
            return "STRING_END";
329
        case PM_TOKEN_SYMBOL_BEGIN:
330
            return "SYMBOL_BEGIN";
331
        case PM_TOKEN_TILDE:
332
            return "TILDE";
333
        case PM_TOKEN_UAMPERSAND:
334
            return "UAMPERSAND";
335
        case PM_TOKEN_UCOLON_COLON:
336
            return "UCOLON_COLON";
337
        case PM_TOKEN_UDOT_DOT:
338
            return "UDOT_DOT";
339
        case PM_TOKEN_UDOT_DOT_DOT:
340
            return "UDOT_DOT_DOT";
341
        case PM_TOKEN_UMINUS:
342
            return "UMINUS";
343
        case PM_TOKEN_UMINUS_NUM:
344
            return "UMINUS_NUM";
345
        case PM_TOKEN_UPLUS:
346
            return "UPLUS";
347
        case PM_TOKEN_USTAR:
348
            return "USTAR";
349
        case PM_TOKEN_USTAR_STAR:
350
            return "USTAR_STAR";
351
        case PM_TOKEN_WORDS_SEP:
352
            return "WORDS_SEP";
353
        case PM_TOKEN_WORDS_SEP_IMPLICIT:
354
            return "WORDS_SEP_IMPLICIT";
355
        case PM_TOKEN_XSTRING_BEGIN:
356
            return "XSTRING_BEGIN";
357
        case PM_TOKEN___END__:
358
            return "__END__";
359
        case PM_TOKEN_MAXIMUM:
360
            PRISM_ASSERT(false && "unreachable");
361
            return "";
362
    }
363
364
    // Provide a default, because some compilers can't determine that the above
365
    // switch is exhaustive.
366
    PRISM_ASSERT(false && "unreachable");
367
    return "";
368
}
369
370
/**
371
 * Returns the human name of the given token type.
372
 */
373
const char *
374
190k
pm_token_str(pm_token_type_t token_type) {
375
190k
    switch (token_type) {
  Branch (375:13): [True: 190k, False: 0]
376
18.7k
        case PM_TOKEN_EOF:
  Branch (376:9): [True: 18.7k, False: 171k]
377
18.7k
            return "end-of-input";
378
48
        case PM_TOKEN_AMPERSAND:
  Branch (378:9): [True: 48, False: 190k]
379
48
            return "'&'";
380
403
        case PM_TOKEN_AMPERSAND_AMPERSAND:
  Branch (380:9): [True: 403, False: 190k]
381
403
            return "'&&'";
382
199
        case PM_TOKEN_AMPERSAND_AMPERSAND_EQUAL:
  Branch (382:9): [True: 199, False: 190k]
383
199
            return "'&&='";
384
20
        case PM_TOKEN_AMPERSAND_DOT:
  Branch (384:9): [True: 20, False: 190k]
385
20
            return "'&.'";
386
105
        case PM_TOKEN_AMPERSAND_EQUAL:
  Branch (386:9): [True: 105, False: 190k]
387
105
            return "'&='";
388
7
        case PM_TOKEN_BACKTICK:
  Branch (388:9): [True: 7, False: 190k]
389
7
            return "'`'";
390
70
        case PM_TOKEN_BACK_REFERENCE:
  Branch (390:9): [True: 70, False: 190k]
391
70
            return "back reference";
392
243
        case PM_TOKEN_BANG:
  Branch (392:9): [True: 243, False: 190k]
393
243
            return "'!'";
394
113
        case PM_TOKEN_BANG_EQUAL:
  Branch (394:9): [True: 113, False: 190k]
395
113
            return "'!='";
396
32
        case PM_TOKEN_BANG_TILDE:
  Branch (396:9): [True: 32, False: 190k]
397
32
            return "'!~'";
398
3.62k
        case PM_TOKEN_BRACE_LEFT:
  Branch (398:9): [True: 3.62k, False: 187k]
399
3.62k
            return "'{'";
400
329
        case PM_TOKEN_BRACE_LEFT_ARGUMENT:
  Branch (400:9): [True: 329, False: 190k]
401
329
            return "'{'";
402
531
        case PM_TOKEN_BRACE_LEFT_HASH:
  Branch (402:9): [True: 531, False: 190k]
403
531
            return "'{'";
404
10.2k
        case PM_TOKEN_BRACE_RIGHT:
  Branch (404:9): [True: 10.2k, False: 180k]
405
10.2k
            return "'}'";
406
341
        case PM_TOKEN_BRACKET_LEFT:
  Branch (406:9): [True: 341, False: 190k]
407
341
            return "'['";
408
1.71k
        case PM_TOKEN_BRACKET_LEFT_ARRAY:
  Branch (408:9): [True: 1.71k, False: 188k]
409
1.71k
            return "'['";
410
4
        case PM_TOKEN_BRACKET_LEFT_RIGHT:
  Branch (410:9): [True: 4, False: 190k]
411
4
            return "'[]'";
412
6
        case PM_TOKEN_BRACKET_LEFT_RIGHT_EQUAL:
  Branch (412:9): [True: 6, False: 190k]
413
6
            return "'[]='";
414
9.40k
        case PM_TOKEN_BRACKET_RIGHT:
  Branch (414:9): [True: 9.40k, False: 181k]
415
9.40k
            return "']'";
416
975
        case PM_TOKEN_CARET:
  Branch (416:9): [True: 975, False: 189k]
417
975
            return "'^'";
418
27
        case PM_TOKEN_CARET_EQUAL:
  Branch (418:9): [True: 27, False: 190k]
419
27
            return "'^='";
420
106
        case PM_TOKEN_CHARACTER_LITERAL:
  Branch (420:9): [True: 106, False: 190k]
421
106
            return "character literal";
422
480
        case PM_TOKEN_CLASS_VARIABLE:
  Branch (422:9): [True: 480, False: 190k]
423
480
            return "class variable";
424
11.6k
        case PM_TOKEN_COLON:
  Branch (424:9): [True: 11.6k, False: 179k]
425
11.6k
            return "':'";
426
209
        case PM_TOKEN_COLON_COLON:
  Branch (426:9): [True: 209, False: 190k]
427
209
            return "'::'";
428
12.6k
        case PM_TOKEN_COMMA:
  Branch (428:9): [True: 12.6k, False: 177k]
429
12.6k
            return "','";
430
0
        case PM_TOKEN_COMMENT:
  Branch (430:9): [True: 0, False: 190k]
431
0
            return "comment";
432
3.57k
        case PM_TOKEN_CONSTANT:
  Branch (432:9): [True: 3.57k, False: 187k]
433
3.57k
            return "constant";
434
1.80k
        case PM_TOKEN_DOT:
  Branch (434:9): [True: 1.80k, False: 188k]
435
1.80k
            return "'.'";
436
201
        case PM_TOKEN_DOT_DOT:
  Branch (436:9): [True: 201, False: 190k]
437
201
            return "..";
438
64
        case PM_TOKEN_DOT_DOT_DOT:
  Branch (438:9): [True: 64, False: 190k]
439
64
            return "...";
440
0
        case PM_TOKEN_EMBDOC_BEGIN:
  Branch (440:9): [True: 0, False: 190k]
441
0
            return "'=begin'";
442
0
        case PM_TOKEN_EMBDOC_END:
  Branch (442:9): [True: 0, False: 190k]
443
0
            return "'=end'";
444
0
        case PM_TOKEN_EMBDOC_LINE:
  Branch (444:9): [True: 0, False: 190k]
445
0
            return "embedded documentation line";
446
12
        case PM_TOKEN_EMBEXPR_BEGIN:
  Branch (446:9): [True: 12, False: 190k]
447
12
            return "'#{'";
448
244
        case PM_TOKEN_EMBEXPR_END:
  Branch (448:9): [True: 244, False: 190k]
449
244
            return "'}'";
450
3
        case PM_TOKEN_EMBVAR:
  Branch (450:9): [True: 3, False: 190k]
451
3
            return "'#'";
452
4.22k
        case PM_TOKEN_EQUAL:
  Branch (452:9): [True: 4.22k, False: 186k]
453
4.22k
            return "'='";
454
244
        case PM_TOKEN_EQUAL_EQUAL:
  Branch (454:9): [True: 244, False: 190k]
455
244
            return "'=='";
456
695
        case PM_TOKEN_EQUAL_EQUAL_EQUAL:
  Branch (456:9): [True: 695, False: 189k]
457
695
            return "'==='";
458
267
        case PM_TOKEN_EQUAL_GREATER:
  Branch (458:9): [True: 267, False: 190k]
459
267
            return "'=>'";
460
1.29k
        case PM_TOKEN_EQUAL_TILDE:
  Branch (460:9): [True: 1.29k, False: 189k]
461
1.29k
            return "'=~'";
462
273
        case PM_TOKEN_FLOAT:
  Branch (462:9): [True: 273, False: 190k]
463
273
            return "float";
464
8
        case PM_TOKEN_FLOAT_IMAGINARY:
  Branch (464:9): [True: 8, False: 190k]
465
8
            return "imaginary";
466
24
        case PM_TOKEN_FLOAT_RATIONAL:
  Branch (466:9): [True: 24, False: 190k]
467
24
            return "rational";
468
5
        case PM_TOKEN_FLOAT_RATIONAL_IMAGINARY:
  Branch (468:9): [True: 5, False: 190k]
469
5
            return "imaginary";
470
1.05k
        case PM_TOKEN_GLOBAL_VARIABLE:
  Branch (470:9): [True: 1.05k, False: 189k]
471
1.05k
            return "global variable";
472
861
        case PM_TOKEN_GREATER:
  Branch (472:9): [True: 861, False: 189k]
473
861
            return "'>'";
474
43
        case PM_TOKEN_GREATER_EQUAL:
  Branch (474:9): [True: 43, False: 190k]
475
43
            return "'>='";
476
585
        case PM_TOKEN_GREATER_GREATER:
  Branch (476:9): [True: 585, False: 190k]
477
585
            return ">>";
478
5
        case PM_TOKEN_GREATER_GREATER_EQUAL:
  Branch (478:9): [True: 5, False: 190k]
479
5
            return ">>=";
480
1.79k
        case PM_TOKEN_HEREDOC_END:
  Branch (480:9): [True: 1.79k, False: 188k]
481
1.79k
            return "heredoc ending";
482
289
        case PM_TOKEN_HEREDOC_START:
  Branch (482:9): [True: 289, False: 190k]
483
289
            return "heredoc beginning";
484
13.9k
        case PM_TOKEN_IDENTIFIER:
  Branch (484:9): [True: 13.9k, False: 176k]
485
13.9k
            return "local variable or method";
486
3
        case PM_TOKEN_IGNORED_NEWLINE:
  Branch (486:9): [True: 3, False: 190k]
487
3
            return "ignored newline";
488
474
        case PM_TOKEN_INSTANCE_VARIABLE:
  Branch (488:9): [True: 474, False: 190k]
489
474
            return "instance variable";
490
3.35k
        case PM_TOKEN_INTEGER:
  Branch (490:9): [True: 3.35k, False: 187k]
491
3.35k
            return "integer";
492
47
        case PM_TOKEN_INTEGER_IMAGINARY:
  Branch (492:9): [True: 47, False: 190k]
493
47
            return "imaginary";
494
40
        case PM_TOKEN_INTEGER_RATIONAL:
  Branch (494:9): [True: 40, False: 190k]
495
40
            return "rational";
496
51
        case PM_TOKEN_INTEGER_RATIONAL_IMAGINARY:
  Branch (496:9): [True: 51, False: 190k]
497
51
            return "imaginary";
498
49
        case PM_TOKEN_KEYWORD_ALIAS:
  Branch (498:9): [True: 49, False: 190k]
499
49
            return "'alias'";
500
243
        case PM_TOKEN_KEYWORD_AND:
  Branch (500:9): [True: 243, False: 190k]
501
243
            return "'and'";
502
56
        case PM_TOKEN_KEYWORD_BEGIN:
  Branch (502:9): [True: 56, False: 190k]
503
56
            return "'begin'";
504
16
        case PM_TOKEN_KEYWORD_BEGIN_UPCASE:
  Branch (504:9): [True: 16, False: 190k]
505
16
            return "'BEGIN'";
506
25
        case PM_TOKEN_KEYWORD_BREAK:
  Branch (506:9): [True: 25, False: 190k]
507
25
            return "'break'";
508
119
        case PM_TOKEN_KEYWORD_CASE:
  Branch (508:9): [True: 119, False: 190k]
509
119
            return "'case'";
510
63
        case PM_TOKEN_KEYWORD_CLASS:
  Branch (510:9): [True: 63, False: 190k]
511
63
            return "'class'";
512
594
        case PM_TOKEN_KEYWORD_DEF:
  Branch (512:9): [True: 594, False: 190k]
513
594
            return "'def'";
514
20
        case PM_TOKEN_KEYWORD_DEFINED:
  Branch (514:9): [True: 20, False: 190k]
515
20
            return "'defined?'";
516
770
        case PM_TOKEN_KEYWORD_DO:
  Branch (516:9): [True: 770, False: 189k]
517
770
            return "'do'";
518
172
        case PM_TOKEN_KEYWORD_DO_BLOCK:
  Branch (518:9): [True: 172, False: 190k]
519
172
            return "'do'";
520
433
        case PM_TOKEN_KEYWORD_DO_LAMBDA:
  Branch (520:9): [True: 433, False: 190k]
521
433
            return "'do'";
522
7
        case PM_TOKEN_KEYWORD_DO_LOOP:
  Branch (522:9): [True: 7, False: 190k]
523
7
            return "'do'";
524
1.38k
        case PM_TOKEN_KEYWORD_ELSE:
  Branch (524:9): [True: 1.38k, False: 189k]
525
1.38k
            return "'else'";
526
399
        case PM_TOKEN_KEYWORD_ELSIF:
  Branch (526:9): [True: 399, False: 190k]
527
399
            return "'elsif'";
528
22.0k
        case PM_TOKEN_KEYWORD_END:
  Branch (528:9): [True: 22.0k, False: 168k]
529
22.0k
            return "'end'";
530
29
        case PM_TOKEN_KEYWORD_END_UPCASE:
  Branch (530:9): [True: 29, False: 190k]
531
29
            return "'END'";
532
1.26k
        case PM_TOKEN_KEYWORD_ENSURE:
  Branch (532:9): [True: 1.26k, False: 189k]
533
1.26k
            return "'ensure'";
534
23
        case PM_TOKEN_KEYWORD_FALSE:
  Branch (534:9): [True: 23, False: 190k]
535
23
            return "'false'";
536
60
        case PM_TOKEN_KEYWORD_FOR:
  Branch (536:9): [True: 60, False: 190k]
537
60
            return "'for'";
538
20
        case PM_TOKEN_KEYWORD_IF:
  Branch (538:9): [True: 20, False: 190k]
539
20
            return "'if'";
540
150
        case PM_TOKEN_KEYWORD_IF_MODIFIER:
  Branch (540:9): [True: 150, False: 190k]
541
150
            return "'if'";
542
1.30k
        case PM_TOKEN_KEYWORD_IN:
  Branch (542:9): [True: 1.30k, False: 189k]
543
1.30k
            return "'in'";
544
19
        case PM_TOKEN_KEYWORD_MODULE:
  Branch (544:9): [True: 19, False: 190k]
545
19
            return "'module'";
546
27
        case PM_TOKEN_KEYWORD_NEXT:
  Branch (546:9): [True: 27, False: 190k]
547
27
            return "'next'";
548
262
        case PM_TOKEN_KEYWORD_NIL:
  Branch (548:9): [True: 262, False: 190k]
549
262
            return "'nil'";
550
30
        case PM_TOKEN_KEYWORD_NOT:
  Branch (550:9): [True: 30, False: 190k]
551
30
            return "'not'";
552
159
        case PM_TOKEN_KEYWORD_OR:
  Branch (552:9): [True: 159, False: 190k]
553
159
            return "'or'";
554
45
        case PM_TOKEN_KEYWORD_REDO:
  Branch (554:9): [True: 45, False: 190k]
555
45
            return "'redo'";
556
1.10k
        case PM_TOKEN_KEYWORD_RESCUE:
  Branch (556:9): [True: 1.10k, False: 189k]
557
1.10k
            return "'rescue'";
558
251
        case PM_TOKEN_KEYWORD_RESCUE_MODIFIER:
  Branch (558:9): [True: 251, False: 190k]
559
251
            return "'rescue' modifier";
560
20
        case PM_TOKEN_KEYWORD_RETRY:
  Branch (560:9): [True: 20, False: 190k]
561
20
            return "'retry'";
562
19
        case PM_TOKEN_KEYWORD_RETURN:
  Branch (562:9): [True: 19, False: 190k]
563
19
            return "'return'";
564
36
        case PM_TOKEN_KEYWORD_SELF:
  Branch (564:9): [True: 36, False: 190k]
565
36
            return "'self'";
566
40
        case PM_TOKEN_KEYWORD_SUPER:
  Branch (566:9): [True: 40, False: 190k]
567
40
            return "'super'";
568
1.16k
        case PM_TOKEN_KEYWORD_THEN:
  Branch (568:9): [True: 1.16k, False: 189k]
569
1.16k
            return "'then'";
570
81
        case PM_TOKEN_KEYWORD_TRUE:
  Branch (570:9): [True: 81, False: 190k]
571
81
            return "'true'";
572
64
        case PM_TOKEN_KEYWORD_UNDEF:
  Branch (572:9): [True: 64, False: 190k]
573
64
            return "'undef'";
574
13
        case PM_TOKEN_KEYWORD_UNLESS:
  Branch (574:9): [True: 13, False: 190k]
575
13
            return "'unless'";
576
178
        case PM_TOKEN_KEYWORD_UNLESS_MODIFIER:
  Branch (576:9): [True: 178, False: 190k]
577
178
            return "'unless'";
578
7
        case PM_TOKEN_KEYWORD_UNTIL:
  Branch (578:9): [True: 7, False: 190k]
579
7
            return "'until'";
580
47
        case PM_TOKEN_KEYWORD_UNTIL_MODIFIER:
  Branch (580:9): [True: 47, False: 190k]
581
47
            return "'until'";
582
657
        case PM_TOKEN_KEYWORD_WHEN:
  Branch (582:9): [True: 657, False: 189k]
583
657
            return "'when'";
584
20
        case PM_TOKEN_KEYWORD_WHILE:
  Branch (584:9): [True: 20, False: 190k]
585
20
            return "'while'";
586
53
        case PM_TOKEN_KEYWORD_WHILE_MODIFIER:
  Branch (586:9): [True: 53, False: 190k]
587
53
            return "'while'";
588
20
        case PM_TOKEN_KEYWORD_YIELD:
  Branch (588:9): [True: 20, False: 190k]
589
20
            return "'yield'";
590
9
        case PM_TOKEN_KEYWORD___ENCODING__:
  Branch (590:9): [True: 9, False: 190k]
591
9
            return "'__ENCODING__'";
592
26
        case PM_TOKEN_KEYWORD___FILE__:
  Branch (592:9): [True: 26, False: 190k]
593
26
            return "'__FILE__'";
594
9
        case PM_TOKEN_KEYWORD___LINE__:
  Branch (594:9): [True: 9, False: 190k]
595
9
            return "'__LINE__'";
596
2.30k
        case PM_TOKEN_LABEL:
  Branch (596:9): [True: 2.30k, False: 188k]
597
2.30k
            return "label";
598
0
        case PM_TOKEN_LABEL_END:
  Branch (598:9): [True: 0, False: 190k]
599
0
            return "label terminator";
600
2.36k
        case PM_TOKEN_LAMBDA_BEGIN:
  Branch (600:9): [True: 2.36k, False: 188k]
601
2.36k
            return "'{'";
602
1.48k
        case PM_TOKEN_LESS:
  Branch (602:9): [True: 1.48k, False: 189k]
603
1.48k
            return "'<'";
604
42
        case PM_TOKEN_LESS_EQUAL:
  Branch (604:9): [True: 42, False: 190k]
605
42
            return "'<='";
606
52
        case PM_TOKEN_LESS_EQUAL_GREATER:
  Branch (606:9): [True: 52, False: 190k]
607
52
            return "'<=>'";
608
588
        case PM_TOKEN_LESS_LESS:
  Branch (608:9): [True: 588, False: 190k]
609
588
            return "<<";
610
17
        case PM_TOKEN_LESS_LESS_EQUAL:
  Branch (610:9): [True: 17, False: 190k]
611
17
            return "<<=";
612
413
        case PM_TOKEN_METHOD_NAME:
  Branch (612:9): [True: 413, False: 190k]
613
413
            return "method name";
614
90
        case PM_TOKEN_MINUS:
  Branch (614:9): [True: 90, False: 190k]
615
90
            return "'-'";
616
30
        case PM_TOKEN_MINUS_EQUAL:
  Branch (616:9): [True: 30, False: 190k]
617
30
            return "'-='";
618
106
        case PM_TOKEN_MINUS_GREATER:
  Branch (618:9): [True: 106, False: 190k]
619
106
            return "'->'";
620
717
        case PM_TOKEN_NEWLINE:
  Branch (620:9): [True: 717, False: 189k]
621
717
            return "newline";
622
0
        case PM_TOKEN_NEWLINE_TERMINATOR:
  Branch (622:9): [True: 0, False: 190k]
623
0
            return "newline";
624
47
        case PM_TOKEN_NUMBERED_REFERENCE:
  Branch (624:9): [True: 47, False: 190k]
625
47
            return "numbered reference";
626
7.25k
        case PM_TOKEN_PARENTHESIS_LEFT:
  Branch (626:9): [True: 7.25k, False: 183k]
627
7.25k
            return "'('";
628
1.43k
        case PM_TOKEN_PARENTHESIS_LEFT_GROUPING:
  Branch (628:9): [True: 1.43k, False: 189k]
629
1.43k
            return "'('";
630
44
        case PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES:
  Branch (630:9): [True: 44, False: 190k]
631
44
            return "'('";
632
16.6k
        case PM_TOKEN_PARENTHESIS_RIGHT:
  Branch (632:9): [True: 16.6k, False: 174k]
633
16.6k
            return "')'";
634
77
        case PM_TOKEN_PERCENT:
  Branch (634:9): [True: 77, False: 190k]
635
77
            return "'%'";
636
16
        case PM_TOKEN_PERCENT_EQUAL:
  Branch (636:9): [True: 16, False: 190k]
637
16
            return "'%='";
638
93
        case PM_TOKEN_PERCENT_LOWER_I:
  Branch (638:9): [True: 93, False: 190k]
639
93
            return "'%i'";
640
108
        case PM_TOKEN_PERCENT_LOWER_W:
  Branch (640:9): [True: 108, False: 190k]
641
108
            return "'%w'";
642
77
        case PM_TOKEN_PERCENT_LOWER_X:
  Branch (642:9): [True: 77, False: 190k]
643
77
            return "'%x'";
644
16
        case PM_TOKEN_PERCENT_UPPER_I:
  Branch (644:9): [True: 16, False: 190k]
645
16
            return "'%I'";
646
23
        case PM_TOKEN_PERCENT_UPPER_W:
  Branch (646:9): [True: 23, False: 190k]
647
23
            return "'%W'";
648
2.58k
        case PM_TOKEN_PIPE:
  Branch (648:9): [True: 2.58k, False: 188k]
649
2.58k
            return "'|'";
650
94
        case PM_TOKEN_PIPE_EQUAL:
  Branch (650:9): [True: 94, False: 190k]
651
94
            return "'|='";
652
37
        case PM_TOKEN_PIPE_PIPE:
  Branch (652:9): [True: 37, False: 190k]
653
37
            return "'||'";
654
242
        case PM_TOKEN_PIPE_PIPE_EQUAL:
  Branch (654:9): [True: 242, False: 190k]
655
242
            return "'||='";
656
106
        case PM_TOKEN_PLUS:
  Branch (656:9): [True: 106, False: 190k]
657
106
            return "'+'";
658
157
        case PM_TOKEN_PLUS_EQUAL:
  Branch (658:9): [True: 157, False: 190k]
659
157
            return "'+='";
660
247
        case PM_TOKEN_QUESTION_MARK:
  Branch (660:9): [True: 247, False: 190k]
661
247
            return "'?'";
662
781
        case PM_TOKEN_REGEXP_BEGIN:
  Branch (662:9): [True: 781, False: 189k]
663
781
            return "regular expression beginning";
664
2
        case PM_TOKEN_REGEXP_END:
  Branch (664:9): [True: 2, False: 190k]
665
2
            return "regular expression ending";
666
1.77k
        case PM_TOKEN_SEMICOLON:
  Branch (666:9): [True: 1.77k, False: 188k]
667
1.77k
            return "';'";
668
1.29k
        case PM_TOKEN_SLASH:
  Branch (668:9): [True: 1.29k, False: 189k]
669
1.29k
            return "'/'";
670
4
        case PM_TOKEN_SLASH_EQUAL:
  Branch (670:9): [True: 4, False: 190k]
671
4
            return "'/='";
672
338
        case PM_TOKEN_STAR:
  Branch (672:9): [True: 338, False: 190k]
673
338
            return "'*'";
674
32
        case PM_TOKEN_STAR_EQUAL:
  Branch (674:9): [True: 32, False: 190k]
675
32
            return "'*='";
676
162
        case PM_TOKEN_STAR_STAR:
  Branch (676:9): [True: 162, False: 190k]
677
162
            return "'**'";
678
15
        case PM_TOKEN_STAR_STAR_EQUAL:
  Branch (678:9): [True: 15, False: 190k]
679
15
            return "'**='";
680
772
        case PM_TOKEN_STRING_BEGIN:
  Branch (680:9): [True: 772, False: 189k]
681
772
            return "string literal";
682
217
        case PM_TOKEN_STRING_CONTENT:
  Branch (682:9): [True: 217, False: 190k]
683
217
            return "string content";
684
7
        case PM_TOKEN_STRING_END:
  Branch (684:9): [True: 7, False: 190k]
685
7
            return "string ending";
686
1.25k
        case PM_TOKEN_SYMBOL_BEGIN:
  Branch (686:9): [True: 1.25k, False: 189k]
687
1.25k
            return "symbol literal";
688
391
        case PM_TOKEN_TILDE:
  Branch (688:9): [True: 391, False: 190k]
689
391
            return "'~'";
690
1.57k
        case PM_TOKEN_UAMPERSAND:
  Branch (690:9): [True: 1.57k, False: 189k]
691
1.57k
            return "'&'";
692
364
        case PM_TOKEN_UCOLON_COLON:
  Branch (692:9): [True: 364, False: 190k]
693
364
            return "'::'";
694
19
        case PM_TOKEN_UDOT_DOT:
  Branch (694:9): [True: 19, False: 190k]
695
19
            return "'..'";
696
18
        case PM_TOKEN_UDOT_DOT_DOT:
  Branch (696:9): [True: 18, False: 190k]
697
18
            return "'...'";
698
207
        case PM_TOKEN_UMINUS:
  Branch (698:9): [True: 207, False: 190k]
699
207
            return "'-'";
700
28
        case PM_TOKEN_UMINUS_NUM:
  Branch (700:9): [True: 28, False: 190k]
701
28
            return "'-'";
702
82
        case PM_TOKEN_UPLUS:
  Branch (702:9): [True: 82, False: 190k]
703
82
            return "'+'";
704
156
        case PM_TOKEN_USTAR:
  Branch (704:9): [True: 156, False: 190k]
705
156
            return "*";
706
1.76k
        case PM_TOKEN_USTAR_STAR:
  Branch (706:9): [True: 1.76k, False: 188k]
707
1.76k
            return "**";
708
183
        case PM_TOKEN_WORDS_SEP:
  Branch (708:9): [True: 183, False: 190k]
709
183
        case PM_TOKEN_WORDS_SEP_IMPLICIT:
  Branch (709:9): [True: 0, False: 190k]
710
183
            return "string separator";
711
301
        case PM_TOKEN_XSTRING_BEGIN:
  Branch (711:9): [True: 301, False: 190k]
712
301
            return "backtick string literal";
713
0
        case PM_TOKEN___END__:
  Branch (713:9): [True: 0, False: 190k]
714
0
            return "'__END__'";
715
0
        case PM_TOKEN_MAXIMUM:
  Branch (715:9): [True: 0, False: 190k]
716
0
            PRISM_ASSERT(false && "unreachable");
  Branch (716:13): [Folded, False: 0]
  Branch (716:13): [True: 0, False: 0]
  Branch (716:13): [Folded, False: 0]
  Branch (716:13): [True: 0, False: 0]
717
0
            return "";
718
190k
    }
719
720
    /* Provide a default, because some compilers cannot determine that the above
721
     * switch is exhaustive. */
722
0
    PRISM_ASSERT(false && "unreachable");
  Branch (722:5): [Folded, False: 0]
  Branch (722:5): [True: 0, False: 0]
  Branch (722:5): [Folded, False: 0]
  Branch (722:5): [True: 0, False: 0]
723
0
    return "";
724
0
}