rbs 1.7.0.beta.2 → 1.7.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,1070 +1,2533 @@
1
+ /* Generated by re2c 2.2 */
2
+ #line 1 "ext/rbs_extension/lexer.re"
1
3
  #include "rbs_extension.h"
2
4
 
3
- #define ONE_CHAR_PATTERN(c, t) case c: tok = next_token(state, t); break
4
-
5
- /**
6
- * Returns one character at current.
7
- *
8
- * ... A B C ...
9
- * ^ current => A
10
- * */
11
- #define peek(state) rb_enc_mbc_to_codepoint(RSTRING_PTR(state->string) + state->current.byte_pos, RSTRING_END(state->string), rb_enc_get(state->string))
12
-
13
- static const char *RBS_TOKENTYPE_NAMES[] = {
14
- "NullType",
15
- "pEOF",
16
- "ErrorToken",
17
-
18
- "pLPAREN", /* ( */
19
- "pRPAREN", /* ) */
20
- "pCOLON", /* : */
21
- "pCOLON2", /* :: */
22
- "pLBRACKET", /* [ */
23
- "pRBRACKET", /* ] */
24
- "pLBRACE", /* { */
25
- "pRBRACE", /* } */
26
- "pHAT", /* ^ */
27
- "pARROW", /* -> */
28
- "pFATARROW", /* => */
29
- "pCOMMA", /* , */
30
- "pBAR", /* | */
31
- "pAMP", /* & */
32
- "pSTAR", /* * */
33
- "pSTAR2", /* ** */
34
- "pDOT", /* . */
35
- "pDOT3", /* ... */
36
- "pBANG", /* ! */
37
- "pQUESTION", /* ? */
38
- "pLT", /* < */
39
- "pEQ", /* = */
40
-
41
- "kBOOL", /* bool */
42
- "kBOT", /* bot */
43
- "kCLASS", /* class */
44
- "kFALSE", /* kFALSE */
45
- "kINSTANCE", /* instance */
46
- "kINTERFACE", /* interface */
47
- "kNIL", /* nil */
48
- "kSELF", /* self */
49
- "kSINGLETON", /* singleton */
50
- "kTOP", /* top */
51
- "kTRUE", /* true */
52
- "kVOID", /* void */
53
- "kTYPE", /* type */
54
- "kUNCHECKED", /* unchecked */
55
- "kIN", /* in */
56
- "kOUT", /* out */
57
- "kEND", /* end */
58
- "kDEF", /* def */
59
- "kINCLUDE", /* include */
60
- "kEXTEND", /* extend */
61
- "kPREPEND", /* prepend */
62
- "kALIAS", /* alias */
63
- "kMODULE", /* module */
64
- "kATTRREADER", /* attr_reader */
65
- "kATTRWRITER", /* attr_writer */
66
- "kATTRACCESSOR", /* attr_accessor */
67
- "kPUBLIC", /* public */
68
- "kPRIVATE", /* private */
69
- "kUNTYPED", /* untyped */
70
-
71
- "tLIDENT", /* Identifiers starting with lower case */
72
- "tUIDENT", /* Identifiers starting with upper case */
73
- "tULIDENT", /* Identifiers starting with `_` */
74
- "tULLIDENT",
75
- "tGIDENT", /* Identifiers starting with `$` */
76
- "tAIDENT", /* Identifiers starting with `@` */
77
- "tA2IDENT", /* Identifiers starting with `@@` */
78
- "tBANGIDENT",
79
- "tEQIDENT",
80
- "tQIDENT", /* Quoted identifier */
81
- "tOPERATOR", /* Operator identifier */
82
-
83
- "tCOMMENT",
84
- "tLINECOMMENT",
85
-
86
- "tDQSTRING", /* Double quoted string */
87
- "tSQSTRING", /* Single quoted string */
88
- "tINTEGER", /* Integer */
89
- "tSYMBOL", /* Symbol */
90
- "tDQSYMBOL",
91
- "tSQSYMBOL",
92
- "tANNOTATION", /* Annotation */
93
- };
94
-
95
- token NullToken = { NullType };
96
- position NullPosition = { -1, -1, -1, -1 };
97
- range NULL_RANGE = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } };
98
-
99
- const char *token_type_str(enum TokenType type) {
100
- return RBS_TOKENTYPE_NAMES[type];
101
- }
102
-
103
- unsigned int peekn(lexstate *state, unsigned int chars[], size_t length) {
104
- int byteoffset = 0;
105
-
106
- rb_encoding *encoding = rb_enc_get(state->string);
107
- char *start = RSTRING_PTR(state->string) + state->current.byte_pos;
108
- char *end = RSTRING_END(state->string);
109
-
110
- for (size_t i = 0; i < length; i++)
111
- {
112
- chars[i] = rb_enc_mbc_to_codepoint(start + byteoffset, end, encoding);
113
- byteoffset += rb_enc_codelen(chars[i], rb_enc_get(state->string));
114
- }
115
-
116
- return byteoffset;
117
- }
118
-
119
- int token_chars(token tok) {
120
- return tok.range.end.char_pos - tok.range.start.char_pos;
121
- }
122
-
123
- int token_bytes(token tok) {
124
- return RANGE_BYTES(tok.range);
125
- }
126
-
127
- /**
128
- * ... token ...
129
- * ^ start
130
- * ^ current
131
- *
132
- * */
133
- token next_token(lexstate *state, enum TokenType type) {
134
- token t;
135
-
136
- t.type = type;
137
- t.range.start = state->start;
138
- t.range.end = state->current;
139
- state->start = state->current;
140
- state->first_token_of_line = false;
141
-
142
- return t;
143
- }
144
-
145
- void advance_skip(lexstate *state, unsigned int c, bool skip) {
146
- int len = rb_enc_codelen(c, rb_enc_get(state->string));
147
-
148
- state->current.char_pos += 1;
149
- state->current.byte_pos += len;
150
-
151
- if (c == '\n') {
152
- state->current.line += 1;
153
- state->current.column = 0;
154
- state->first_token_of_line = true;
155
- } else {
156
- state->current.column += 1;
157
- }
158
-
159
- if (skip) {
160
- state->start = state->current;
161
- }
162
- }
163
-
164
- void advance_char(lexstate *state, unsigned int c) {
165
- advance_skip(state, c, false);
166
- }
167
-
168
- void skip_char(lexstate *state, unsigned int c) {
169
- advance_skip(state, c, true);
170
- }
171
-
172
- void skip(lexstate *state) {
173
- unsigned char c = peek(state);
174
- skip_char(state, c);
175
- }
176
-
177
- void advance(lexstate *state) {
178
- unsigned char c = peek(state);
179
- advance_char(state, c);
180
- }
181
-
182
- /*
183
- 1. Peek one character from state
184
- 2. If read characetr equals to given `c`, skip the character and return true.
185
- 3. Return false otherwise.
186
- */
187
- static bool advance_next_character_if(lexstate *state, unsigned int c) {
188
- if (peek(state) == c) {
189
- advance_char(state, c);
190
- return true;
191
- } else {
192
- return false;
193
- }
194
- }
195
-
196
- /*
197
- ... 0 1 ...
198
- ^ current
199
- ^ current (return)
200
- */
201
- static token lex_number(lexstate *state) {
202
- unsigned int c;
203
-
204
- while (true) {
205
- c = peek(state);
206
-
207
- if (rb_isdigit(c) || c == '_') {
208
- advance_char(state, c);
209
- } else {
210
- break;
211
- }
212
- }
213
-
214
- return next_token(state, tINTEGER);
215
- }
216
-
217
- /*
218
- lex_hyphen ::= - (tOPERATOR)
219
- | - @ (tOPERATOR)
220
- | - > (pARROW)
221
- | - 1 ... (tINTEGER)
222
- */
223
- static token lex_hyphen(lexstate* state) {
224
- if (advance_next_character_if(state, '>')) {
225
- return next_token(state, pARROW);
226
- } else if (advance_next_character_if(state, '@')) {
227
- return next_token(state, tOPERATOR);
228
- } else {
229
- unsigned int c = peek(state);
230
-
231
- if (rb_isdigit(c)) {
232
- advance_char(state, c);
233
- return lex_number(state);
234
- } else {
235
- return next_token(state, tOPERATOR);
236
- }
237
- }
238
- }
239
-
240
- /*
241
- lex_plus ::= +
242
- | + @
243
- | + \d
244
- */
245
- static token lex_plus(lexstate *state) {
246
- if (advance_next_character_if(state, '@')) {
247
- return next_token(state, tOPERATOR);
248
- } else if (rb_isdigit(peek(state))) {
249
- return lex_number(state);
250
- } else {
251
- return next_token(state, tOPERATOR);
252
- }
253
- }
254
-
255
- /*
256
- lex_dot ::= . pDOT
257
- | . . . pDOT3
258
- */
259
- static token lex_dot(lexstate *state) {
260
- unsigned int cs[2];
261
-
262
- peekn(state, cs, 2);
263
-
264
- if (cs[0] == '.' && cs[1] == '.') {
265
- advance_char(state, '.');
266
- advance_char(state, '.');
267
- return next_token(state, pDOT3);
268
- } else {
269
- return next_token(state, pDOT);
270
- }
271
- }
272
-
273
- /*
274
- lex_eq ::= =
275
- | ==
276
- | ===
277
- | =~
278
- | =>
279
- */
280
- static token lex_eq(lexstate *state) {
281
- unsigned int cs[2];
282
- peekn(state, cs, 2);
283
-
284
- if (cs[0] == '=' && cs[1] == '=') {
285
- // ===
286
- advance_char(state, cs[0]);
287
- advance_char(state, cs[1]);
288
- return next_token(state, tOPERATOR);
289
- } else if (cs[0] == '=') {
290
- // ==
291
- advance_char(state, cs[0]);
292
- return next_token(state, tOPERATOR);
293
- } else if (cs[0] == '~') {
294
- // =~
295
- advance_char(state, cs[0]);
296
- return next_token(state, tOPERATOR);
297
- } else if (cs[0] == '>') {
298
- // =>
299
- advance_char(state, cs[0]);
300
- return next_token(state, pFATARROW);
301
- } else {
302
- return next_token(state, pEQ);
303
- }
304
- }
305
-
306
- /*
307
- underscore ::= _A tULIDENT
308
- | _a tULLIDENT
309
- | _ tULLIDENT
310
- */
311
- static token lex_underscore(lexstate *state) {
312
- unsigned int c;
313
-
314
- c = peek(state);
315
-
316
- if ('A' <= c && c <= 'Z') {
317
- advance_char(state, c);
318
-
319
- while (true) {
320
- c = peek(state);
321
-
322
- if (rb_isalnum(c) || c == '_') {
323
- // ok
324
- advance_char(state, c);
325
- } else {
326
- break;
327
- }
328
- }
329
-
330
- return next_token(state, tULIDENT);
331
- } else if (rb_isalnum(c) || c == '_') {
332
- advance_char(state, c);
333
-
334
- while (true) {
335
- c = peek(state);
336
-
337
- if (rb_isalnum(c) || c == '_') {
338
- // ok
339
- advance_char(state, c);
340
- } else {
341
- break;
342
- }
343
- }
344
-
345
- if (c == '!') {
346
- advance_char(state, c);
347
- return next_token(state, tBANGIDENT);
348
- } else if (c == '=') {
349
- advance_char(state, c);
350
- return next_token(state, tEQIDENT);
351
- } else {
352
- return next_token(state, tULLIDENT);
353
- }
354
- } else {
355
- return next_token(state, tULLIDENT);
356
- }
357
- }
358
-
359
- static bool is_opr(unsigned int c) {
360
- switch (c) {
361
- case ':':
362
- case ';':
363
- case '=':
364
- case '.':
365
- case ',':
366
- case '!':
367
- case '"':
368
- case '$':
369
- case '%':
370
- case '&':
371
- case '(':
372
- case ')':
373
- case '-':
374
- case '+':
375
- case '~':
376
- case '|':
377
- case '\\':
378
- case '\'':
379
- case '[':
380
- case ']':
381
- case '{':
382
- case '}':
383
- case '*':
384
- case '/':
385
- case '<':
386
- case '>':
387
- case '^':
388
- return true;
389
- default:
390
- return false;
391
- }
392
- }
393
-
394
- static token lex_global(lexstate *state) {
395
- unsigned int c;
396
-
397
- c = peek(state);
398
-
399
- if (rb_isspace(c) || c == 0) {
400
- return next_token(state, ErrorToken);
401
- }
402
-
403
- if (rb_isdigit(c)) {
404
- // `$` [`0`-`9`]+
405
- advance_char(state, c);
406
-
407
- while (true) {
408
- c = peek(state);
409
- if (rb_isdigit(c)) {
410
- advance_char(state, c);
411
- } else {
412
- return next_token(state, tGIDENT);
413
- }
414
- }
415
- }
416
-
417
- if (c == '-') {
418
- // `$` `-` [a-zA-Z0-9_]
419
- advance_char(state, c);
420
- c = peek(state);
421
-
422
- if (rb_isalnum(c) || c == '_') {
423
- advance_char(state, c);
424
- return next_token(state, tGIDENT);
425
- } else {
426
- return next_token(state, ErrorToken);
427
- }
428
- }
429
-
430
- switch (c) {
431
- case '~':
432
- case '*':
433
- case '$':
434
- case '?':
435
- case '!':
436
- case '@':
437
- case '\\':
438
- case '/':
439
- case ';':
440
- case ',':
441
- case '.':
442
- case '=':
443
- case ':':
444
- case '<':
445
- case '>':
446
- case '"':
447
- case '&':
448
- case '\'':
449
- case '`':
450
- case '+':
451
- advance_char(state, c);
452
- return next_token(state, tGIDENT);
453
-
454
- default:
455
- if (is_opr(c) || c == 0) {
456
- return next_token(state, ErrorToken);
457
- }
458
-
459
- while (true) {
460
- advance_char(state, c);
461
- c = peek(state);
462
-
463
- if (rb_isspace(c) || is_opr(c) || c == 0) {
464
- break;
465
- }
466
- }
467
-
468
- return next_token(state, tGIDENT);
469
- }
470
- }
471
-
472
- void pp(VALUE object) {
473
- VALUE inspect = rb_funcall(object, rb_intern("inspect"), 0);
474
- printf("pp >> %s\n", RSTRING_PTR(inspect));
475
- }
476
-
477
- static token lex_ident(lexstate *state, enum TokenType default_type) {
478
- unsigned int c;
479
- token tok;
480
-
481
- while (true) {
482
- c = peek(state);
483
- if (rb_isalnum(c) || c == '_') {
484
- advance_char(state, c);
485
- } else if (c == '!') {
486
- advance_char(state, c);
487
- tok = next_token(state, tBANGIDENT);
488
- break;
489
- } else if (c == '=') {
490
- advance_char(state, c);
491
- tok = next_token(state, tEQIDENT);
492
- break;
493
- } else {
494
- tok = next_token(state, default_type);
495
- break;
496
- }
497
- }
498
-
499
- if (tok.type == tLIDENT) {
500
- VALUE string = rb_enc_str_new(
501
- RSTRING_PTR(state->string) + tok.range.start.byte_pos,
502
- RANGE_BYTES(tok.range),
503
- rb_enc_get(state->string)
504
- );
505
-
506
- VALUE type = rb_hash_aref(RBS_Parser_KEYWORDS, string);
507
- if (FIXNUM_P(type)) {
508
- tok.type = FIX2INT(type);
509
- }
510
- }
511
-
512
- return tok;
513
- }
514
-
515
- static token lex_comment(lexstate *state, enum TokenType type) {
516
- unsigned int c;
517
-
518
- c = peek(state);
519
- if (c == ' ') {
520
- advance_char(state, c);
521
- }
522
-
523
- while (true) {
524
- c = peek(state);
525
-
526
- if (c == '\n' || c == '\0') {
527
- break;
528
- } else {
529
- advance_char(state, c);
530
- }
531
- }
532
-
533
- token tok = next_token(state, type);
534
-
535
- skip_char(state, c);
536
-
537
- return tok;
538
- }
539
-
540
- /*
541
- ... " ... " ...
542
- ^ start
543
- ^ current
544
- ^ current (after)
545
- */
546
- static token lex_dqstring(lexstate *state) {
547
- unsigned int c;
548
-
549
- while (true) {
550
- c = peek(state);
551
- advance_char(state, c);
552
-
553
- if (c == '\\') {
554
- if (peek(state) == '"') {
555
- advance_char(state, c);
556
- c = peek(state);
557
- }
558
- } else if (c == '"') {
559
- break;
560
- }
561
- }
562
-
563
- return next_token(state, tDQSTRING);
564
- }
565
-
566
- /*
567
- ... @ foo ...
568
- ^ start
569
- ^ current
570
- ^ current (return)
571
-
572
- ... @ @ foo ...
573
- ^ start
574
- ^ current
575
- ^ current (return)
576
- */
577
- static token lex_ivar(lexstate *state) {
578
- unsigned int c;
579
-
580
- enum TokenType type = tAIDENT;
581
-
582
- c = peek(state);
583
-
584
- if (c == '@') {
585
- type = tA2IDENT;
586
- advance_char(state, c);
587
- c = peek(state);
588
- }
589
-
590
- if (rb_isalpha(c) || c == '_') {
591
- advance_char(state, c);
592
- c = peek(state);
593
- } else {
594
- return next_token(state, ErrorToken);
595
- }
596
-
597
- while (rb_isalnum(c) || c == '_') {
598
- advance_char(state, c);
599
- c = peek(state);
600
- }
601
-
602
- return next_token(state, type);
603
- }
604
-
605
- /*
606
- ... ' ... ' ...
607
- ^ start
608
- ^ current
609
- ^ current (after)
610
- */
611
- static token lex_sqstring(lexstate *state) {
612
- unsigned int c;
613
-
614
- c = peek(state);
615
-
616
- while (true) {
617
- c = peek(state);
618
- advance_char(state, c);
619
-
620
- if (c == '\\') {
621
- if (peek(state) == '\'') {
622
- advance_char(state, c);
623
- c = peek(state);
624
- }
625
- } else if (c == '\'') {
626
- break;
627
- }
628
- }
629
-
630
- return next_token(state, tSQSTRING);
631
- }
632
-
633
- #define EQPOINTS2(c0, c1, s) (c0 == s[0] && c1 == s[1])
634
- #define EQPOINTS3(c0, c1, c2, s) (c0 == s[0] && c1 == s[1] && c2 == s[2])
635
-
636
- /*
637
- ... : @ ...
638
- ^ start
639
- ^ current
640
- ^ current (return)
641
- */
642
- static token lex_colon_symbol(lexstate *state) {
643
- unsigned int c[3];
644
- peekn(state, c, 3);
645
-
646
- switch (c[0]) {
647
- case '|':
648
- case '&':
649
- case '/':
650
- case '%':
651
- case '~':
652
- case '`':
653
- case '^':
654
- advance_char(state, c[0]);
655
- return next_token(state, tSYMBOL);
656
- case '=':
657
- if (EQPOINTS2(c[0], c[1], "=~")) {
658
- // :=~
659
- advance_char(state, c[0]);
660
- advance_char(state, c[1]);
661
- return next_token(state, tSYMBOL);
662
- } else if (EQPOINTS3(c[0], c[1], c[2], "===")) {
663
- // :===
664
- advance_char(state, c[0]);
665
- advance_char(state, c[1]);
666
- advance_char(state, c[2]);
667
- return next_token(state, tSYMBOL);
668
- } else if (EQPOINTS2(c[0], c[1], "==")) {
669
- // :==
670
- advance_char(state, c[0]);
671
- advance_char(state, c[1]);
672
- return next_token(state, tSYMBOL);
673
- }
674
- break;
675
- case '<':
676
- if (EQPOINTS3(c[0], c[1], c[2], "<=>")) {
677
- advance_char(state, c[0]);
678
- advance_char(state, c[1]);
679
- advance_char(state, c[2]);
680
- } else if (EQPOINTS2(c[0], c[1], "<=") || EQPOINTS2(c[0], c[1], "<<")) {
681
- advance_char(state, c[0]);
682
- advance_char(state, c[1]);
683
- } else {
684
- advance_char(state, c[0]);
685
- }
686
- return next_token(state, tSYMBOL);
687
- case '>':
688
- if (EQPOINTS2(c[0], c[1], ">=") || EQPOINTS2(c[0], c[1], ">>")) {
689
- advance_char(state, c[0]);
690
- advance_char(state, c[1]);
691
- } else {
692
- advance_char(state, c[0]);
693
- }
694
- return next_token(state, tSYMBOL);
695
- case '-':
696
- case '+':
697
- if (EQPOINTS2(c[0], c[1], "+@") || EQPOINTS2(c[0], c[1], "-@")) {
698
- advance_char(state, c[0]);
699
- advance_char(state, c[1]);
700
- } else {
701
- advance_char(state, c[0]);
702
- }
703
- return next_token(state, tSYMBOL);
704
- case '*':
705
- if (EQPOINTS2(c[0], c[1], "**")) {
706
- advance_char(state, c[0]);
707
- advance_char(state, c[1]);
708
- } else {
709
- advance_char(state, c[0]);
710
- }
711
- return next_token(state, tSYMBOL);
712
- case '[':
713
- if (EQPOINTS3(c[0], c[1], c[2], "[]=")) {
714
- advance_char(state, c[0]);
715
- advance_char(state, c[1]);
716
- advance_char(state, c[2]);
717
- } else if (EQPOINTS2(c[0], c[1], "[]")) {
718
- advance_char(state, c[0]);
719
- advance_char(state, c[1]);
720
- } else {
721
- break;
722
- }
723
- return next_token(state, tSYMBOL);
724
- case '!':
725
- if (EQPOINTS2(c[0], c[1], "!=") || EQPOINTS2(c[0], c[1], "!~")) {
726
- advance_char(state, c[0]);
727
- advance_char(state, c[1]);
728
- } else {
729
- advance_char(state, c[0]);
730
- }
731
- return next_token(state, tSYMBOL);
732
- case '@': {
733
- advance_char(state, '@');
734
- token tok = lex_ivar(state);
735
- if (tok.type != ErrorToken) {
736
- tok.type = tSYMBOL;
737
- }
738
- return tok;
739
- }
740
- case '$': {
741
- advance_char(state, '$');
742
- token tok = lex_global(state);
743
- if (tok.type != ErrorToken) {
744
- tok.type = tSYMBOL;
745
- }
746
- return tok;
747
- }
748
- case '\'': {
749
- position start = state->start;
750
- advance_char(state, '\'');
751
- token tok = lex_sqstring(state);
752
- tok.type = tSQSYMBOL;
753
- tok.range.start = start;
754
- return tok;
755
- }
756
- case '"': {
757
- position start = state->start;
758
- advance_char(state, '"');
759
- token tok = lex_dqstring(state);
760
- tok.type = tDQSYMBOL;
761
- tok.range.start = start;
762
- return tok;
763
- }
764
- default:
765
- if (rb_isalpha(c[0]) || c[0] == '_') {
766
- position start = state->start;
767
- token tok = lex_ident(state, NullType);
768
- tok.range.start = start;
769
-
770
- if (peek(state) == '?') {
771
- if (tok.type != tBANGIDENT && tok.type != tEQIDENT) {
772
- skip_char(state, '?');
773
- tok.range.end = state->current;
774
- }
775
- }
776
-
777
- tok.type = tSYMBOL;
778
- return tok;
779
- }
780
- }
781
-
782
- return next_token(state, pCOLON);
783
- }
784
-
785
- /*
786
- ... : : ...
787
- ^ start
788
- ^ current
789
- ^ current (return)
790
-
791
- ... : ...
792
- ^ start
793
- ^ current (lex_colon_symbol)
794
- */
795
- static token lex_colon(lexstate *state) {
796
- unsigned int c = peek(state);
797
-
798
- if (c == ':') {
799
- advance_char(state, c);
800
- return next_token(state, pCOLON2);
801
- } else {
802
- return lex_colon_symbol(state);
803
- }
804
- }
805
-
806
- /*
807
- lex_lt ::= < (pLT)
808
- | < < (tOPERATOR)
809
- | < = (tOPERATOR)
810
- | < = > (tOPERATOR)
811
- */
812
- static token lex_lt(lexstate *state) {
813
- if (advance_next_character_if(state, '<')) {
814
- return next_token(state, tOPERATOR);
815
- } else if (advance_next_character_if(state, '=')) {
816
- advance_next_character_if(state, '>');
817
- return next_token(state, tOPERATOR);
818
- } else {
819
- return next_token(state, pLT);
820
- }
821
- }
822
-
823
- /*
824
- lex_gt ::= >
825
- | > =
826
- | > >
827
- */
828
- static token lex_gt(lexstate *state) {
829
- advance_next_character_if(state, '=') || advance_next_character_if(state, '>');
830
- return next_token(state, tOPERATOR);
831
- }
832
-
833
- /*
834
- ... `%` `a` `{` ... `}` ...
835
- ^ start
836
- ^ current
837
- ^ current (exit)
838
- --- token
839
- */
840
- static token lex_percent(lexstate *state) {
841
- unsigned int cs[2];
842
- unsigned int end_char;
843
-
844
- peekn(state, cs, 2);
845
-
846
- if (cs[0] != 'a') {
847
- return next_token(state, tOPERATOR);
848
- }
849
-
850
- switch (cs[1])
851
- {
852
- case '{':
853
- end_char = '}';
854
- break;
855
- case '(':
856
- end_char = ')';
857
- break;
858
- case '[':
859
- end_char = ']';
860
- break;
861
- case '|':
862
- end_char = '|';
863
- break;
864
- case '<':
865
- end_char = '>';
866
- break;
867
- default:
868
- return next_token(state, tOPERATOR);
869
- }
870
-
871
- advance_char(state, cs[0]);
872
- advance_char(state, cs[1]);
873
-
874
- unsigned int c;
875
-
876
- while ((c = peek(state))) {
877
- if (c == end_char) {
878
- advance_char(state, c);
879
- return next_token(state, tANNOTATION);
880
- }
881
- advance_char(state, c);
882
- }
883
-
884
- return next_token(state, ErrorToken);
885
- }
886
-
887
- /*
888
- bracket ::= [ (pLBRACKET)
889
- * ^
890
- | [ ] (tOPERATOR)
891
- * ^ $
892
- | [ ] = (tOPERATOR)
893
- * ^ $
894
- */
895
- static token lex_bracket(lexstate *state) {
896
- if (advance_next_character_if(state, ']')) {
897
- advance_next_character_if(state, '=');
898
- return next_token(state, tOPERATOR);
899
- } else {
900
- return next_token(state, pLBRACKET);
901
- }
902
- }
903
-
904
- /*
905
- bracket ::= *
906
- | * *
907
- */
908
- static token lex_star(lexstate *state) {
909
- if (advance_next_character_if(state, '*')) {
910
- return next_token(state, pSTAR2);
911
- } else {
912
- return next_token(state, pSTAR);
913
- }
914
- }
915
-
916
- /*
917
- bang ::= !
918
- | ! =
919
- | ! ~
920
- */
921
- static token lex_bang(lexstate *state) {
922
- advance_next_character_if(state, '=') || advance_next_character_if(state, '~');
923
- return next_token(state, tOPERATOR);
924
- }
925
-
926
- /*
927
- backquote ::= ` (tOPERATOR)
928
- | `[^ :][^`]` (tQIDENT)
929
- */
930
- static token lex_backquote(lexstate *state) {
931
- unsigned int c = peek(state);
932
-
933
- if (c == ' ' || c == ':') {
934
- return next_token(state, tOPERATOR);
935
- } else {
936
- while (true) {
937
- if (c == '`') {
938
- break;
939
- }
940
-
941
- c = peek(state);
942
- advance_char(state, c);
943
- }
944
-
945
- return next_token(state, tQIDENT);
946
- }
947
- }
948
-
949
5
  token rbsparser_next_token(lexstate *state) {
950
- token tok = NullToken;
951
-
952
- unsigned int c;
953
- bool skipping = true;
954
-
955
- while (skipping) {
956
- c = peek(state);
957
-
958
- switch (c) {
959
- case ' ':
960
- case '\t':
961
- case '\n':
962
- // nop
963
- skip_char(state, c);
964
- break;
965
- case '\0':
966
- return next_token(state, pEOF);
967
- default:
968
- advance_char(state, c);
969
- skipping = false;
970
- break;
971
- }
972
- }
973
-
974
- /* ... c d .. */
975
- /* ^ state->current */
976
- /* ^ start */
977
- switch (c) {
978
- case '\0': tok = next_token(state, pEOF);
979
- ONE_CHAR_PATTERN('(', pLPAREN);
980
- ONE_CHAR_PATTERN(')', pRPAREN);
981
- ONE_CHAR_PATTERN(']', pRBRACKET);
982
- ONE_CHAR_PATTERN('{', pLBRACE);
983
- ONE_CHAR_PATTERN('}', pRBRACE);
984
- ONE_CHAR_PATTERN(',', pCOMMA);
985
- ONE_CHAR_PATTERN('|', pBAR);
986
- ONE_CHAR_PATTERN('^', pHAT);
987
- ONE_CHAR_PATTERN('&', pAMP);
988
- ONE_CHAR_PATTERN('?', pQUESTION);
989
- ONE_CHAR_PATTERN('/', tOPERATOR);
990
- ONE_CHAR_PATTERN('~', tOPERATOR);
991
- case '[':
992
- tok = lex_bracket(state);
993
- break;
994
- case '-':
995
- tok = lex_hyphen(state);
996
- break;
997
- case '+':
998
- tok = lex_plus(state);
999
- break;
1000
- case '*':
1001
- tok = lex_star(state);
1002
- break;
1003
- case '<':
1004
- tok = lex_lt(state);
1005
- break;
1006
- case '=':
1007
- tok = lex_eq(state);
1008
- break;
1009
- case '>':
1010
- tok = lex_gt(state);
1011
- break;
1012
- case '!':
1013
- tok = lex_bang(state);
1014
- break;
1015
- case '#':
1016
- if (state->first_token_of_line) {
1017
- tok = lex_comment(state, tLINECOMMENT);
1018
- } else {
1019
- tok = lex_comment(state, tCOMMENT);
6
+ lexstate backup;
7
+
8
+ start:
9
+ backup = *state;
10
+
11
+
12
+ #line 13 "ext/rbs_extension/lexer.c"
13
+ {
14
+ unsigned int yych;
15
+ unsigned int yyaccept = 0;
16
+ yych = peek(state);
17
+ switch (yych) {
18
+ case 0x00000000: goto yy2;
19
+ case '\t':
20
+ case '\n':
21
+ case ' ': goto yy6;
22
+ case '!': goto yy9;
23
+ case '"': goto yy11;
24
+ case '#': goto yy12;
25
+ case '$': goto yy15;
26
+ case '%': goto yy16;
27
+ case '&': goto yy17;
28
+ case '\'': goto yy19;
29
+ case '(': goto yy20;
30
+ case ')': goto yy22;
31
+ case '*': goto yy24;
32
+ case '+': goto yy26;
33
+ case ',': goto yy27;
34
+ case '-': goto yy29;
35
+ case '.': goto yy30;
36
+ case '/':
37
+ case '~': goto yy32;
38
+ case '0':
39
+ case '1':
40
+ case '2':
41
+ case '3':
42
+ case '4':
43
+ case '5':
44
+ case '6':
45
+ case '7':
46
+ case '8':
47
+ case '9': goto yy33;
48
+ case ':': goto yy36;
49
+ case '<': goto yy38;
50
+ case '=': goto yy40;
51
+ case '>': goto yy42;
52
+ case '?': goto yy43;
53
+ case '@': goto yy45;
54
+ case 'A':
55
+ case 'B':
56
+ case 'C':
57
+ case 'D':
58
+ case 'E':
59
+ case 'F':
60
+ case 'G':
61
+ case 'H':
62
+ case 'I':
63
+ case 'J':
64
+ case 'K':
65
+ case 'L':
66
+ case 'M':
67
+ case 'N':
68
+ case 'O':
69
+ case 'P':
70
+ case 'Q':
71
+ case 'R':
72
+ case 'S':
73
+ case 'T':
74
+ case 'U':
75
+ case 'V':
76
+ case 'W':
77
+ case 'X':
78
+ case 'Y':
79
+ case 'Z': goto yy46;
80
+ case '[': goto yy49;
81
+ case ']': goto yy51;
82
+ case '^': goto yy53;
83
+ case '_': goto yy55;
84
+ case '`': goto yy57;
85
+ case 'a': goto yy59;
86
+ case 'b': goto yy61;
87
+ case 'c': goto yy62;
88
+ case 'd': goto yy63;
89
+ case 'e': goto yy64;
90
+ case 'f': goto yy65;
91
+ case 'g':
92
+ case 'h':
93
+ case 'j':
94
+ case 'k':
95
+ case 'l':
96
+ case 'q':
97
+ case 'r':
98
+ case 'w':
99
+ case 'x':
100
+ case 'y':
101
+ case 'z': goto yy66;
102
+ case 'i': goto yy68;
103
+ case 'm': goto yy69;
104
+ case 'n': goto yy70;
105
+ case 'o': goto yy71;
106
+ case 'p': goto yy72;
107
+ case 's': goto yy73;
108
+ case 't': goto yy74;
109
+ case 'u': goto yy75;
110
+ case 'v': goto yy76;
111
+ case '{': goto yy77;
112
+ case '|': goto yy79;
113
+ case '}': goto yy81;
114
+ default: goto yy4;
115
+ }
116
+ yy2:
117
+ skip(state);
118
+ #line 137 "ext/rbs_extension/lexer.re"
119
+ { return next_token(state, pEOF); }
120
+ #line 121 "ext/rbs_extension/lexer.c"
121
+ yy4:
122
+ skip(state);
123
+ yy5:
124
+ #line 138 "ext/rbs_extension/lexer.re"
125
+ { return next_token(state, ErrorToken); }
126
+ #line 127 "ext/rbs_extension/lexer.c"
127
+ yy6:
128
+ skip(state);
129
+ yych = peek(state);
130
+ if (yych <= 0x00000008) goto yy8;
131
+ if (yych <= '\n') goto yy6;
132
+ if (yych == ' ') goto yy6;
133
+ yy8:
134
+ #line 136 "ext/rbs_extension/lexer.re"
135
+ { state->start = state->current; goto start; }
136
+ #line 137 "ext/rbs_extension/lexer.c"
137
+ yy9:
138
+ skip(state);
139
+ yych = peek(state);
140
+ if (yych == '=') goto yy32;
141
+ if (yych == '~') goto yy32;
142
+ yy10:
143
+ #line 48 "ext/rbs_extension/lexer.re"
144
+ { return next_token(state, tOPERATOR); }
145
+ #line 146 "ext/rbs_extension/lexer.c"
146
+ yy11:
147
+ yyaccept = 0;
148
+ skip(state);
149
+ backup = *state;
150
+ yych = peek(state);
151
+ if (yych <= 0x00000000) goto yy5;
152
+ goto yy84;
153
+ yy12:
154
+ skip(state);
155
+ yych = peek(state);
156
+ if (yych <= 0x00000000) goto yy14;
157
+ if (yych != '\n') goto yy12;
158
+ yy14:
159
+ #line 59 "ext/rbs_extension/lexer.re"
160
+ {
161
+ return next_token(
162
+ state,
163
+ state->first_token_of_line ? tLINECOMMENT : tCOMMENT
164
+ );
1020
165
  }
1021
- break;
1022
- case ':':
1023
- tok = lex_colon(state);
1024
- break;
1025
- case '.':
1026
- tok = lex_dot(state);
1027
- break;
1028
- case '_':
1029
- tok = lex_underscore(state);
1030
- break;
1031
- case '$':
1032
- tok = lex_global(state);
1033
- break;
1034
- case '@':
1035
- tok = lex_ivar(state);
1036
- break;
1037
- case '"':
1038
- tok = lex_dqstring(state);
1039
- break;
1040
- case '\'':
1041
- tok = lex_sqstring(state);
1042
- break;
1043
- case '%':
1044
- tok = lex_percent(state);
1045
- break;
1046
- case '`':
1047
- tok = lex_backquote(state);
1048
- break;
1049
- default:
1050
- if (rb_isalpha(c) && rb_isupper(c)) {
1051
- tok = lex_ident(state, tUIDENT);
1052
- }
1053
- if (rb_isalpha(c) && rb_islower(c)) {
1054
- tok = lex_ident(state, tLIDENT);
1055
- }
1056
- if (rb_isdigit(c)) {
1057
- tok = lex_number(state);
1058
- }
1059
- }
1060
-
1061
- if (tok.type == NullType) {
1062
- tok = next_token(state, ErrorToken);
1063
- }
1064
-
1065
- return tok;
166
+ #line 167 "ext/rbs_extension/lexer.c"
167
+ yy15:
168
+ skip(state);
169
+ yych = peek(state);
170
+ if (yych <= ')') {
171
+ if (yych <= 0x0000001F) {
172
+ if (yych <= '\n') {
173
+ if (yych <= 0x00000000) goto yy5;
174
+ if (yych <= 0x00000008) goto yy90;
175
+ goto yy5;
176
+ } else {
177
+ if (yych == '\r') goto yy5;
178
+ goto yy90;
179
+ }
180
+ } else {
181
+ if (yych <= '#') {
182
+ if (yych <= ' ') goto yy5;
183
+ if (yych <= '"') goto yy93;
184
+ goto yy90;
185
+ } else {
186
+ if (yych == '%') goto yy5;
187
+ if (yych <= '\'') goto yy93;
188
+ goto yy5;
189
+ }
190
+ }
191
+ } else {
192
+ if (yych <= 'Z') {
193
+ if (yych <= '/') {
194
+ if (yych == '-') goto yy90;
195
+ goto yy93;
196
+ } else {
197
+ if (yych <= '9') goto yy90;
198
+ if (yych <= '>') goto yy93;
199
+ goto yy90;
200
+ }
201
+ } else {
202
+ if (yych <= '^') {
203
+ if (yych == '\\') goto yy93;
204
+ goto yy5;
205
+ } else {
206
+ if (yych <= 'z') goto yy90;
207
+ if (yych <= '}') goto yy5;
208
+ if (yych <= '~') goto yy93;
209
+ goto yy90;
210
+ }
211
+ }
212
+ }
213
+ yy16:
214
+ yyaccept = 1;
215
+ skip(state);
216
+ backup = *state;
217
+ yych = peek(state);
218
+ if (yych == 'a') goto yy94;
219
+ goto yy10;
220
+ yy17:
221
+ skip(state);
222
+ #line 34 "ext/rbs_extension/lexer.re"
223
+ { return next_token(state, pAMP); }
224
+ #line 225 "ext/rbs_extension/lexer.c"
225
+ yy19:
226
+ yyaccept = 0;
227
+ skip(state);
228
+ backup = *state;
229
+ yych = peek(state);
230
+ if (yych <= 0x00000000) goto yy5;
231
+ goto yy96;
232
+ yy20:
233
+ skip(state);
234
+ #line 25 "ext/rbs_extension/lexer.re"
235
+ { return next_token(state, pLPAREN); }
236
+ #line 237 "ext/rbs_extension/lexer.c"
237
+ yy22:
238
+ skip(state);
239
+ #line 26 "ext/rbs_extension/lexer.re"
240
+ { return next_token(state, pRPAREN); }
241
+ #line 242 "ext/rbs_extension/lexer.c"
242
+ yy24:
243
+ skip(state);
244
+ yych = peek(state);
245
+ if (yych == '*') goto yy101;
246
+ #line 36 "ext/rbs_extension/lexer.re"
247
+ { return next_token(state, pSTAR); }
248
+ #line 249 "ext/rbs_extension/lexer.c"
249
+ yy26:
250
+ skip(state);
251
+ yych = peek(state);
252
+ if (yych <= '/') goto yy10;
253
+ if (yych <= '9') goto yy33;
254
+ if (yych == '@') goto yy32;
255
+ goto yy10;
256
+ yy27:
257
+ skip(state);
258
+ #line 31 "ext/rbs_extension/lexer.re"
259
+ { return next_token(state, pCOMMA); }
260
+ #line 261 "ext/rbs_extension/lexer.c"
261
+ yy29:
262
+ skip(state);
263
+ yych = peek(state);
264
+ if (yych <= '=') {
265
+ if (yych <= '/') goto yy10;
266
+ if (yych <= '9') goto yy33;
267
+ goto yy10;
268
+ } else {
269
+ if (yych <= '>') goto yy103;
270
+ if (yych == '@') goto yy32;
271
+ goto yy10;
272
+ }
273
+ yy30:
274
+ yyaccept = 2;
275
+ skip(state);
276
+ backup = *state;
277
+ yych = peek(state);
278
+ if (yych == '.') goto yy105;
279
+ yy31:
280
+ #line 38 "ext/rbs_extension/lexer.re"
281
+ { return next_token(state, pDOT); }
282
+ #line 283 "ext/rbs_extension/lexer.c"
283
+ yy32:
284
+ skip(state);
285
+ goto yy10;
286
+ yy33:
287
+ skip(state);
288
+ yych = peek(state);
289
+ if (yych <= '/') goto yy35;
290
+ if (yych <= '9') goto yy33;
291
+ if (yych == '_') goto yy33;
292
+ yy35:
293
+ #line 51 "ext/rbs_extension/lexer.re"
294
+ { return next_token(state, tINTEGER); }
295
+ #line 296 "ext/rbs_extension/lexer.c"
296
+ yy36:
297
+ yyaccept = 3;
298
+ skip(state);
299
+ backup = *state;
300
+ yych = peek(state);
301
+ switch (yych) {
302
+ case '!': goto yy106;
303
+ case '"': goto yy108;
304
+ case '$': goto yy110;
305
+ case '%':
306
+ case '&':
307
+ case '/':
308
+ case '^':
309
+ case '`':
310
+ case '|':
311
+ case '~': goto yy111;
312
+ case '\'': goto yy112;
313
+ case '*': goto yy114;
314
+ case '+':
315
+ case '-': goto yy115;
316
+ case ':': goto yy116;
317
+ case '<': goto yy118;
318
+ case '=': goto yy119;
319
+ case '>': goto yy120;
320
+ case '@': goto yy121;
321
+ case 'A':
322
+ case 'B':
323
+ case 'C':
324
+ case 'D':
325
+ case 'E':
326
+ case 'F':
327
+ case 'G':
328
+ case 'H':
329
+ case 'I':
330
+ case 'J':
331
+ case 'K':
332
+ case 'L':
333
+ case 'M':
334
+ case 'N':
335
+ case 'O':
336
+ case 'P':
337
+ case 'Q':
338
+ case 'R':
339
+ case 'S':
340
+ case 'T':
341
+ case 'U':
342
+ case 'V':
343
+ case 'W':
344
+ case 'X':
345
+ case 'Y':
346
+ case 'Z':
347
+ case '_':
348
+ case 'a':
349
+ case 'b':
350
+ case 'c':
351
+ case 'd':
352
+ case 'e':
353
+ case 'f':
354
+ case 'g':
355
+ case 'h':
356
+ case 'i':
357
+ case 'j':
358
+ case 'k':
359
+ case 'l':
360
+ case 'm':
361
+ case 'n':
362
+ case 'o':
363
+ case 'p':
364
+ case 'q':
365
+ case 'r':
366
+ case 's':
367
+ case 't':
368
+ case 'u':
369
+ case 'v':
370
+ case 'w':
371
+ case 'x':
372
+ case 'y':
373
+ case 'z': goto yy122;
374
+ case '[': goto yy125;
375
+ default: goto yy37;
376
+ }
377
+ yy37:
378
+ #line 45 "ext/rbs_extension/lexer.re"
379
+ { return next_token(state, pCOLON); }
380
+ #line 381 "ext/rbs_extension/lexer.c"
381
+ yy38:
382
+ skip(state);
383
+ yych = peek(state);
384
+ if (yych <= ';') goto yy39;
385
+ if (yych <= '<') goto yy32;
386
+ if (yych <= '=') goto yy126;
387
+ yy39:
388
+ #line 47 "ext/rbs_extension/lexer.re"
389
+ { return next_token(state, pLT); }
390
+ #line 391 "ext/rbs_extension/lexer.c"
391
+ yy40:
392
+ skip(state);
393
+ yych = peek(state);
394
+ if (yych <= '>') {
395
+ if (yych <= '<') goto yy41;
396
+ if (yych <= '=') goto yy127;
397
+ goto yy128;
398
+ } else {
399
+ if (yych == '~') goto yy32;
400
+ }
401
+ yy41:
402
+ #line 44 "ext/rbs_extension/lexer.re"
403
+ { return next_token(state, pEQ); }
404
+ #line 405 "ext/rbs_extension/lexer.c"
405
+ yy42:
406
+ skip(state);
407
+ yych = peek(state);
408
+ if (yych <= '<') goto yy10;
409
+ if (yych <= '>') goto yy32;
410
+ goto yy10;
411
+ yy43:
412
+ skip(state);
413
+ #line 35 "ext/rbs_extension/lexer.re"
414
+ { return next_token(state, pQUESTION); }
415
+ #line 416 "ext/rbs_extension/lexer.c"
416
+ yy45:
417
+ yyaccept = 0;
418
+ skip(state);
419
+ backup = *state;
420
+ yych = peek(state);
421
+ if (yych <= '^') {
422
+ if (yych <= '?') goto yy5;
423
+ if (yych <= '@') goto yy130;
424
+ if (yych <= 'Z') goto yy131;
425
+ goto yy5;
426
+ } else {
427
+ if (yych == '`') goto yy5;
428
+ if (yych <= 'z') goto yy131;
429
+ goto yy5;
430
+ }
431
+ yy46:
432
+ skip(state);
433
+ yych = peek(state);
434
+ if (yych <= '=') {
435
+ if (yych <= '/') {
436
+ if (yych == '!') goto yy134;
437
+ } else {
438
+ if (yych <= '9') goto yy46;
439
+ if (yych >= '=') goto yy136;
440
+ }
441
+ } else {
442
+ if (yych <= '^') {
443
+ if (yych <= '@') goto yy48;
444
+ if (yych <= 'Z') goto yy46;
445
+ } else {
446
+ if (yych == '`') goto yy48;
447
+ if (yych <= 'z') goto yy46;
448
+ }
449
+ }
450
+ yy48:
451
+ #line 122 "ext/rbs_extension/lexer.re"
452
+ { return next_token(state, tUIDENT); }
453
+ #line 454 "ext/rbs_extension/lexer.c"
454
+ yy49:
455
+ skip(state);
456
+ yych = peek(state);
457
+ if (yych == ']') goto yy127;
458
+ #line 27 "ext/rbs_extension/lexer.re"
459
+ { return next_token(state, pLBRACKET); }
460
+ #line 461 "ext/rbs_extension/lexer.c"
461
+ yy51:
462
+ skip(state);
463
+ #line 28 "ext/rbs_extension/lexer.re"
464
+ { return next_token(state, pRBRACKET); }
465
+ #line 466 "ext/rbs_extension/lexer.c"
466
+ yy53:
467
+ skip(state);
468
+ #line 33 "ext/rbs_extension/lexer.re"
469
+ { return next_token(state, pHAT); }
470
+ #line 471 "ext/rbs_extension/lexer.c"
471
+ yy55:
472
+ skip(state);
473
+ yych = peek(state);
474
+ if (yych <= '=') {
475
+ if (yych <= '/') {
476
+ if (yych == '!') goto yy134;
477
+ } else {
478
+ if (yych <= '9') goto yy138;
479
+ if (yych >= '=') goto yy136;
480
+ }
481
+ } else {
482
+ if (yych <= '^') {
483
+ if (yych <= '@') goto yy56;
484
+ if (yych <= 'Z') goto yy141;
485
+ } else {
486
+ if (yych == '`') goto yy56;
487
+ if (yych <= 'z') goto yy138;
488
+ }
489
+ }
490
+ yy56:
491
+ #line 125 "ext/rbs_extension/lexer.re"
492
+ { return next_token(state, tULLIDENT); }
493
+ #line 494 "ext/rbs_extension/lexer.c"
494
+ yy57:
495
+ yyaccept = 4;
496
+ skip(state);
497
+ backup = *state;
498
+ yych = peek(state);
499
+ if (yych <= ' ') {
500
+ if (yych <= 0x00000000) goto yy58;
501
+ if (yych <= 0x0000001F) goto yy144;
502
+ } else {
503
+ if (yych != ':') goto yy144;
504
+ }
505
+ yy58:
506
+ #line 40 "ext/rbs_extension/lexer.re"
507
+ { return next_token(state, tOPERATOR); }
508
+ #line 509 "ext/rbs_extension/lexer.c"
509
+ yy59:
510
+ skip(state);
511
+ yych = peek(state);
512
+ if (yych == 'l') goto yy146;
513
+ if (yych == 't') goto yy147;
514
+ goto yy67;
515
+ yy60:
516
+ #line 121 "ext/rbs_extension/lexer.re"
517
+ { return next_token(state, tLIDENT); }
518
+ #line 519 "ext/rbs_extension/lexer.c"
519
+ yy61:
520
+ skip(state);
521
+ yych = peek(state);
522
+ if (yych == 'o') goto yy148;
523
+ goto yy67;
524
+ yy62:
525
+ skip(state);
526
+ yych = peek(state);
527
+ if (yych == 'l') goto yy149;
528
+ goto yy67;
529
+ yy63:
530
+ skip(state);
531
+ yych = peek(state);
532
+ if (yych == 'e') goto yy150;
533
+ goto yy67;
534
+ yy64:
535
+ skip(state);
536
+ yych = peek(state);
537
+ if (yych == 'n') goto yy151;
538
+ if (yych == 'x') goto yy152;
539
+ goto yy67;
540
+ yy65:
541
+ skip(state);
542
+ yych = peek(state);
543
+ if (yych == 'a') goto yy153;
544
+ goto yy67;
545
+ yy66:
546
+ skip(state);
547
+ yych = peek(state);
548
+ yy67:
549
+ if (yych <= '=') {
550
+ if (yych <= '/') {
551
+ if (yych == '!') goto yy134;
552
+ goto yy60;
553
+ } else {
554
+ if (yych <= '9') goto yy66;
555
+ if (yych <= '<') goto yy60;
556
+ goto yy136;
557
+ }
558
+ } else {
559
+ if (yych <= '^') {
560
+ if (yych <= '@') goto yy60;
561
+ if (yych <= 'Z') goto yy66;
562
+ goto yy60;
563
+ } else {
564
+ if (yych == '`') goto yy60;
565
+ if (yych <= 'z') goto yy66;
566
+ goto yy60;
567
+ }
568
+ }
569
+ yy68:
570
+ skip(state);
571
+ yych = peek(state);
572
+ if (yych == 'n') goto yy154;
573
+ goto yy67;
574
+ yy69:
575
+ skip(state);
576
+ yych = peek(state);
577
+ if (yych == 'o') goto yy156;
578
+ goto yy67;
579
+ yy70:
580
+ skip(state);
581
+ yych = peek(state);
582
+ if (yych == 'i') goto yy157;
583
+ goto yy67;
584
+ yy71:
585
+ skip(state);
586
+ yych = peek(state);
587
+ if (yych == 'u') goto yy158;
588
+ goto yy67;
589
+ yy72:
590
+ skip(state);
591
+ yych = peek(state);
592
+ if (yych == 'r') goto yy159;
593
+ if (yych == 'u') goto yy160;
594
+ goto yy67;
595
+ yy73:
596
+ skip(state);
597
+ yych = peek(state);
598
+ if (yych == 'e') goto yy161;
599
+ if (yych == 'i') goto yy162;
600
+ goto yy67;
601
+ yy74:
602
+ skip(state);
603
+ yych = peek(state);
604
+ if (yych <= 'q') {
605
+ if (yych == 'o') goto yy163;
606
+ goto yy67;
607
+ } else {
608
+ if (yych <= 'r') goto yy164;
609
+ if (yych == 'y') goto yy165;
610
+ goto yy67;
611
+ }
612
+ yy75:
613
+ skip(state);
614
+ yych = peek(state);
615
+ if (yych == 'n') goto yy166;
616
+ goto yy67;
617
+ yy76:
618
+ skip(state);
619
+ yych = peek(state);
620
+ if (yych == 'o') goto yy167;
621
+ goto yy67;
622
+ yy77:
623
+ skip(state);
624
+ #line 29 "ext/rbs_extension/lexer.re"
625
+ { return next_token(state, pLBRACE); }
626
+ #line 627 "ext/rbs_extension/lexer.c"
627
+ yy79:
628
+ skip(state);
629
+ #line 32 "ext/rbs_extension/lexer.re"
630
+ { return next_token(state, pBAR); }
631
+ #line 632 "ext/rbs_extension/lexer.c"
632
+ yy81:
633
+ skip(state);
634
+ #line 30 "ext/rbs_extension/lexer.re"
635
+ { return next_token(state, pRBRACE); }
636
+ #line 637 "ext/rbs_extension/lexer.c"
637
+ yy83:
638
+ skip(state);
639
+ yych = peek(state);
640
+ yy84:
641
+ if (yych <= '"') {
642
+ if (yych <= 0x00000000) goto yy85;
643
+ if (yych <= '!') goto yy83;
644
+ goto yy86;
645
+ } else {
646
+ if (yych == '\\') goto yy88;
647
+ goto yy83;
648
+ }
649
+ yy85:
650
+ *state = backup;
651
+ if (yyaccept <= 4) {
652
+ if (yyaccept <= 2) {
653
+ if (yyaccept <= 1) {
654
+ if (yyaccept == 0) {
655
+ goto yy5;
656
+ } else {
657
+ goto yy10;
658
+ }
659
+ } else {
660
+ goto yy31;
661
+ }
662
+ } else {
663
+ if (yyaccept == 3) {
664
+ goto yy37;
665
+ } else {
666
+ goto yy58;
667
+ }
668
+ }
669
+ } else {
670
+ if (yyaccept <= 6) {
671
+ if (yyaccept == 5) {
672
+ goto yy87;
673
+ } else {
674
+ goto yy98;
675
+ }
676
+ } else {
677
+ if (yyaccept == 7) {
678
+ goto yy183;
679
+ } else {
680
+ goto yy191;
681
+ }
682
+ }
683
+ }
684
+ yy86:
685
+ skip(state);
686
+ yy87:
687
+ #line 99 "ext/rbs_extension/lexer.re"
688
+ { return next_token(state, tDQSTRING); }
689
+ #line 690 "ext/rbs_extension/lexer.c"
690
+ yy88:
691
+ skip(state);
692
+ yych = peek(state);
693
+ if (yych <= '"') {
694
+ if (yych <= 0x00000000) goto yy85;
695
+ if (yych <= '!') goto yy83;
696
+ goto yy168;
697
+ } else {
698
+ if (yych == '\\') goto yy88;
699
+ goto yy83;
700
+ }
701
+ yy90:
702
+ skip(state);
703
+ yych = peek(state);
704
+ if (yych <= ',') {
705
+ if (yych <= '\f') {
706
+ if (yych <= 0x00000000) goto yy92;
707
+ if (yych <= 0x00000008) goto yy90;
708
+ if (yych >= '\v') goto yy90;
709
+ } else {
710
+ if (yych <= 0x0000001F) {
711
+ if (yych >= 0x0000000E) goto yy90;
712
+ } else {
713
+ if (yych == '#') goto yy90;
714
+ }
715
+ }
716
+ } else {
717
+ if (yych <= '>') {
718
+ if (yych <= '-') goto yy90;
719
+ if (yych <= '/') goto yy92;
720
+ if (yych <= '9') goto yy90;
721
+ } else {
722
+ if (yych <= '^') {
723
+ if (yych <= 'Z') goto yy90;
724
+ } else {
725
+ if (yych <= 'z') goto yy90;
726
+ if (yych >= 0x0000007F) goto yy90;
727
+ }
728
+ }
729
+ }
730
+ yy92:
731
+ #line 132 "ext/rbs_extension/lexer.re"
732
+ { return next_token(state, tGIDENT); }
733
+ #line 734 "ext/rbs_extension/lexer.c"
734
+ yy93:
735
+ skip(state);
736
+ goto yy92;
737
+ yy94:
738
+ skip(state);
739
+ yych = peek(state);
740
+ if (yych <= 'Z') {
741
+ if (yych <= '(') {
742
+ if (yych <= '\'') goto yy85;
743
+ goto yy169;
744
+ } else {
745
+ if (yych == '<') goto yy171;
746
+ goto yy85;
747
+ }
748
+ } else {
749
+ if (yych <= 'z') {
750
+ if (yych <= '[') goto yy173;
751
+ goto yy85;
752
+ } else {
753
+ if (yych <= '{') goto yy175;
754
+ if (yych <= '|') goto yy177;
755
+ goto yy85;
756
+ }
757
+ }
758
+ yy95:
759
+ skip(state);
760
+ yych = peek(state);
761
+ yy96:
762
+ if (yych <= '\'') {
763
+ if (yych <= 0x00000000) goto yy85;
764
+ if (yych <= '&') goto yy95;
765
+ } else {
766
+ if (yych == '\\') goto yy99;
767
+ goto yy95;
768
+ }
769
+ yy97:
770
+ skip(state);
771
+ yy98:
772
+ #line 100 "ext/rbs_extension/lexer.re"
773
+ { return next_token(state, tSQSTRING); }
774
+ #line 775 "ext/rbs_extension/lexer.c"
775
+ yy99:
776
+ skip(state);
777
+ yych = peek(state);
778
+ if (yych <= '\'') {
779
+ if (yych <= 0x00000000) goto yy85;
780
+ if (yych <= '&') goto yy95;
781
+ goto yy179;
782
+ } else {
783
+ if (yych == '\\') goto yy99;
784
+ goto yy95;
785
+ }
786
+ yy101:
787
+ skip(state);
788
+ #line 37 "ext/rbs_extension/lexer.re"
789
+ { return next_token(state, pSTAR2); }
790
+ #line 791 "ext/rbs_extension/lexer.c"
791
+ yy103:
792
+ skip(state);
793
+ #line 42 "ext/rbs_extension/lexer.re"
794
+ { return next_token(state, pARROW); }
795
+ #line 796 "ext/rbs_extension/lexer.c"
796
+ yy105:
797
+ skip(state);
798
+ yych = peek(state);
799
+ if (yych == '.') goto yy180;
800
+ goto yy85;
801
+ yy106:
802
+ skip(state);
803
+ yych = peek(state);
804
+ if (yych == '=') goto yy111;
805
+ if (yych == '~') goto yy111;
806
+ yy107:
807
+ #line 119 "ext/rbs_extension/lexer.re"
808
+ { return next_token(state, tSYMBOL); }
809
+ #line 810 "ext/rbs_extension/lexer.c"
810
+ yy108:
811
+ skip(state);
812
+ yych = peek(state);
813
+ if (yych <= '"') {
814
+ if (yych <= 0x00000000) goto yy85;
815
+ if (yych <= '!') goto yy108;
816
+ goto yy182;
817
+ } else {
818
+ if (yych == '\\') goto yy184;
819
+ goto yy108;
820
+ }
821
+ yy110:
822
+ skip(state);
823
+ yych = peek(state);
824
+ if (yych <= ')') {
825
+ if (yych <= 0x0000001F) {
826
+ if (yych <= '\n') {
827
+ if (yych <= 0x00000000) goto yy85;
828
+ if (yych <= 0x00000008) goto yy186;
829
+ goto yy85;
830
+ } else {
831
+ if (yych == '\r') goto yy85;
832
+ goto yy186;
833
+ }
834
+ } else {
835
+ if (yych <= '#') {
836
+ if (yych <= ' ') goto yy85;
837
+ if (yych <= '"') goto yy189;
838
+ goto yy186;
839
+ } else {
840
+ if (yych == '%') goto yy85;
841
+ if (yych <= '\'') goto yy189;
842
+ goto yy85;
843
+ }
844
+ }
845
+ } else {
846
+ if (yych <= 'Z') {
847
+ if (yych <= '/') {
848
+ if (yych == '-') goto yy186;
849
+ goto yy189;
850
+ } else {
851
+ if (yych <= '9') goto yy186;
852
+ if (yych <= '>') goto yy189;
853
+ goto yy186;
854
+ }
855
+ } else {
856
+ if (yych <= '^') {
857
+ if (yych == '\\') goto yy189;
858
+ goto yy85;
859
+ } else {
860
+ if (yych <= 'z') goto yy186;
861
+ if (yych <= '}') goto yy85;
862
+ if (yych <= '~') goto yy189;
863
+ goto yy186;
864
+ }
865
+ }
866
+ }
867
+ yy111:
868
+ skip(state);
869
+ goto yy107;
870
+ yy112:
871
+ skip(state);
872
+ yych = peek(state);
873
+ if (yych <= '\'') {
874
+ if (yych <= 0x00000000) goto yy85;
875
+ if (yych <= '&') goto yy112;
876
+ goto yy190;
877
+ } else {
878
+ if (yych == '\\') goto yy192;
879
+ goto yy112;
880
+ }
881
+ yy114:
882
+ skip(state);
883
+ yych = peek(state);
884
+ if (yych == '*') goto yy111;
885
+ goto yy107;
886
+ yy115:
887
+ skip(state);
888
+ yych = peek(state);
889
+ if (yych == '@') goto yy111;
890
+ goto yy107;
891
+ yy116:
892
+ skip(state);
893
+ #line 46 "ext/rbs_extension/lexer.re"
894
+ { return next_token(state, pCOLON2); }
895
+ #line 896 "ext/rbs_extension/lexer.c"
896
+ yy118:
897
+ skip(state);
898
+ yych = peek(state);
899
+ if (yych <= ';') goto yy107;
900
+ if (yych <= '<') goto yy111;
901
+ if (yych <= '=') goto yy194;
902
+ goto yy107;
903
+ yy119:
904
+ skip(state);
905
+ yych = peek(state);
906
+ if (yych == '=') goto yy195;
907
+ if (yych == '~') goto yy111;
908
+ goto yy85;
909
+ yy120:
910
+ skip(state);
911
+ yych = peek(state);
912
+ if (yych <= '<') goto yy107;
913
+ if (yych <= '>') goto yy111;
914
+ goto yy107;
915
+ yy121:
916
+ skip(state);
917
+ yych = peek(state);
918
+ if (yych <= '^') {
919
+ if (yych <= '?') goto yy85;
920
+ if (yych <= '@') goto yy196;
921
+ if (yych <= 'Z') goto yy197;
922
+ goto yy85;
923
+ } else {
924
+ if (yych == '`') goto yy85;
925
+ if (yych <= 'z') goto yy197;
926
+ goto yy85;
927
+ }
928
+ yy122:
929
+ skip(state);
930
+ yych = peek(state);
931
+ if (yych <= '>') {
932
+ if (yych <= '/') {
933
+ if (yych == '!') goto yy200;
934
+ } else {
935
+ if (yych <= '9') goto yy122;
936
+ if (yych == '=') goto yy200;
937
+ }
938
+ } else {
939
+ if (yych <= '^') {
940
+ if (yych <= '?') goto yy200;
941
+ if (yych <= '@') goto yy124;
942
+ if (yych <= 'Z') goto yy122;
943
+ } else {
944
+ if (yych == '`') goto yy124;
945
+ if (yych <= 'z') goto yy122;
946
+ }
947
+ }
948
+ yy124:
949
+ #line 115 "ext/rbs_extension/lexer.re"
950
+ { return next_token(state, tSYMBOL); }
951
+ #line 952 "ext/rbs_extension/lexer.c"
952
+ yy125:
953
+ skip(state);
954
+ yych = peek(state);
955
+ if (yych == ']') goto yy195;
956
+ goto yy85;
957
+ yy126:
958
+ skip(state);
959
+ yych = peek(state);
960
+ if (yych == '>') goto yy32;
961
+ goto yy10;
962
+ yy127:
963
+ skip(state);
964
+ yych = peek(state);
965
+ if (yych == '=') goto yy32;
966
+ goto yy10;
967
+ yy128:
968
+ skip(state);
969
+ #line 43 "ext/rbs_extension/lexer.re"
970
+ { return next_token(state, pFATARROW); }
971
+ #line 972 "ext/rbs_extension/lexer.c"
972
+ yy130:
973
+ skip(state);
974
+ yych = peek(state);
975
+ if (yych <= '^') {
976
+ if (yych <= '@') goto yy85;
977
+ if (yych <= 'Z') goto yy201;
978
+ goto yy85;
979
+ } else {
980
+ if (yych == '`') goto yy85;
981
+ if (yych <= 'z') goto yy201;
982
+ goto yy85;
983
+ }
984
+ yy131:
985
+ skip(state);
986
+ yych = peek(state);
987
+ if (yych <= 'Z') {
988
+ if (yych <= '/') goto yy133;
989
+ if (yych <= '9') goto yy131;
990
+ if (yych >= 'A') goto yy131;
991
+ } else {
992
+ if (yych <= '_') {
993
+ if (yych >= '_') goto yy131;
994
+ } else {
995
+ if (yych <= '`') goto yy133;
996
+ if (yych <= 'z') goto yy131;
997
+ }
998
+ }
999
+ yy133:
1000
+ #line 129 "ext/rbs_extension/lexer.re"
1001
+ { return next_token(state, tAIDENT); }
1002
+ #line 1003 "ext/rbs_extension/lexer.c"
1003
+ yy134:
1004
+ skip(state);
1005
+ #line 126 "ext/rbs_extension/lexer.re"
1006
+ { return next_token(state, tBANGIDENT); }
1007
+ #line 1008 "ext/rbs_extension/lexer.c"
1008
+ yy136:
1009
+ skip(state);
1010
+ #line 127 "ext/rbs_extension/lexer.re"
1011
+ { return next_token(state, tEQIDENT); }
1012
+ #line 1013 "ext/rbs_extension/lexer.c"
1013
+ yy138:
1014
+ skip(state);
1015
+ yych = peek(state);
1016
+ if (yych <= '=') {
1017
+ if (yych <= '/') {
1018
+ if (yych == '!') goto yy134;
1019
+ } else {
1020
+ if (yych <= '9') goto yy138;
1021
+ if (yych >= '=') goto yy136;
1022
+ }
1023
+ } else {
1024
+ if (yych <= '^') {
1025
+ if (yych <= '@') goto yy140;
1026
+ if (yych <= 'Z') goto yy138;
1027
+ } else {
1028
+ if (yych == '`') goto yy140;
1029
+ if (yych <= 'z') goto yy138;
1030
+ }
1031
+ }
1032
+ yy140:
1033
+ #line 123 "ext/rbs_extension/lexer.re"
1034
+ { return next_token(state, tULLIDENT); }
1035
+ #line 1036 "ext/rbs_extension/lexer.c"
1036
+ yy141:
1037
+ skip(state);
1038
+ yych = peek(state);
1039
+ if (yych <= '=') {
1040
+ if (yych <= '/') {
1041
+ if (yych == '!') goto yy134;
1042
+ } else {
1043
+ if (yych <= '9') goto yy141;
1044
+ if (yych >= '=') goto yy136;
1045
+ }
1046
+ } else {
1047
+ if (yych <= '^') {
1048
+ if (yych <= '@') goto yy143;
1049
+ if (yych <= 'Z') goto yy141;
1050
+ } else {
1051
+ if (yych == '`') goto yy143;
1052
+ if (yych <= 'z') goto yy141;
1053
+ }
1054
+ }
1055
+ yy143:
1056
+ #line 124 "ext/rbs_extension/lexer.re"
1057
+ { return next_token(state, tULIDENT); }
1058
+ #line 1059 "ext/rbs_extension/lexer.c"
1059
+ yy144:
1060
+ skip(state);
1061
+ yych = peek(state);
1062
+ if (yych <= 0x00000000) goto yy85;
1063
+ if (yych == '`') goto yy204;
1064
+ goto yy144;
1065
+ yy146:
1066
+ skip(state);
1067
+ yych = peek(state);
1068
+ if (yych == 'i') goto yy206;
1069
+ goto yy67;
1070
+ yy147:
1071
+ skip(state);
1072
+ yych = peek(state);
1073
+ if (yych == 't') goto yy207;
1074
+ goto yy67;
1075
+ yy148:
1076
+ skip(state);
1077
+ yych = peek(state);
1078
+ if (yych == 'o') goto yy208;
1079
+ if (yych == 't') goto yy209;
1080
+ goto yy67;
1081
+ yy149:
1082
+ skip(state);
1083
+ yych = peek(state);
1084
+ if (yych == 'a') goto yy211;
1085
+ goto yy67;
1086
+ yy150:
1087
+ skip(state);
1088
+ yych = peek(state);
1089
+ if (yych == 'f') goto yy212;
1090
+ goto yy67;
1091
+ yy151:
1092
+ skip(state);
1093
+ yych = peek(state);
1094
+ if (yych == 'd') goto yy214;
1095
+ goto yy67;
1096
+ yy152:
1097
+ skip(state);
1098
+ yych = peek(state);
1099
+ if (yych == 't') goto yy216;
1100
+ goto yy67;
1101
+ yy153:
1102
+ skip(state);
1103
+ yych = peek(state);
1104
+ if (yych == 'l') goto yy217;
1105
+ goto yy67;
1106
+ yy154:
1107
+ skip(state);
1108
+ yych = peek(state);
1109
+ if (yych <= '^') {
1110
+ if (yych <= '9') {
1111
+ if (yych == '!') goto yy134;
1112
+ if (yych >= '0') goto yy66;
1113
+ } else {
1114
+ if (yych <= '=') {
1115
+ if (yych >= '=') goto yy136;
1116
+ } else {
1117
+ if (yych <= '@') goto yy155;
1118
+ if (yych <= 'Z') goto yy66;
1119
+ }
1120
+ }
1121
+ } else {
1122
+ if (yych <= 'c') {
1123
+ if (yych == '`') goto yy155;
1124
+ if (yych <= 'b') goto yy66;
1125
+ goto yy218;
1126
+ } else {
1127
+ if (yych <= 's') {
1128
+ if (yych <= 'r') goto yy66;
1129
+ goto yy219;
1130
+ } else {
1131
+ if (yych <= 't') goto yy220;
1132
+ if (yych <= 'z') goto yy66;
1133
+ }
1134
+ }
1135
+ }
1136
+ yy155:
1137
+ #line 77 "ext/rbs_extension/lexer.re"
1138
+ { return next_token(state, kIN); }
1139
+ #line 1140 "ext/rbs_extension/lexer.c"
1140
+ yy156:
1141
+ skip(state);
1142
+ yych = peek(state);
1143
+ if (yych == 'd') goto yy221;
1144
+ goto yy67;
1145
+ yy157:
1146
+ skip(state);
1147
+ yych = peek(state);
1148
+ if (yych == 'l') goto yy222;
1149
+ goto yy67;
1150
+ yy158:
1151
+ skip(state);
1152
+ yych = peek(state);
1153
+ if (yych == 't') goto yy224;
1154
+ goto yy67;
1155
+ yy159:
1156
+ skip(state);
1157
+ yych = peek(state);
1158
+ if (yych == 'e') goto yy226;
1159
+ if (yych == 'i') goto yy227;
1160
+ goto yy67;
1161
+ yy160:
1162
+ skip(state);
1163
+ yych = peek(state);
1164
+ if (yych == 'b') goto yy228;
1165
+ goto yy67;
1166
+ yy161:
1167
+ skip(state);
1168
+ yych = peek(state);
1169
+ if (yych == 'l') goto yy229;
1170
+ goto yy67;
1171
+ yy162:
1172
+ skip(state);
1173
+ yych = peek(state);
1174
+ if (yych == 'n') goto yy230;
1175
+ goto yy67;
1176
+ yy163:
1177
+ skip(state);
1178
+ yych = peek(state);
1179
+ if (yych == 'p') goto yy231;
1180
+ goto yy67;
1181
+ yy164:
1182
+ skip(state);
1183
+ yych = peek(state);
1184
+ if (yych == 'u') goto yy233;
1185
+ goto yy67;
1186
+ yy165:
1187
+ skip(state);
1188
+ yych = peek(state);
1189
+ if (yych == 'p') goto yy234;
1190
+ goto yy67;
1191
+ yy166:
1192
+ skip(state);
1193
+ yych = peek(state);
1194
+ if (yych == 'c') goto yy235;
1195
+ if (yych == 't') goto yy236;
1196
+ goto yy67;
1197
+ yy167:
1198
+ skip(state);
1199
+ yych = peek(state);
1200
+ if (yych == 'i') goto yy237;
1201
+ goto yy67;
1202
+ yy168:
1203
+ yyaccept = 5;
1204
+ skip(state);
1205
+ backup = *state;
1206
+ yych = peek(state);
1207
+ if (yych <= '"') {
1208
+ if (yych <= 0x00000000) goto yy87;
1209
+ if (yych <= '!') goto yy83;
1210
+ goto yy86;
1211
+ } else {
1212
+ if (yych == '\\') goto yy88;
1213
+ goto yy83;
1214
+ }
1215
+ yy169:
1216
+ skip(state);
1217
+ yych = peek(state);
1218
+ if (yych <= 0x00000000) goto yy85;
1219
+ if (yych == ')') goto yy238;
1220
+ goto yy169;
1221
+ yy171:
1222
+ skip(state);
1223
+ yych = peek(state);
1224
+ if (yych <= 0x00000000) goto yy85;
1225
+ if (yych == '>') goto yy240;
1226
+ goto yy171;
1227
+ yy173:
1228
+ skip(state);
1229
+ yych = peek(state);
1230
+ if (yych <= 0x00000000) goto yy85;
1231
+ if (yych == ']') goto yy242;
1232
+ goto yy173;
1233
+ yy175:
1234
+ skip(state);
1235
+ yych = peek(state);
1236
+ if (yych <= 0x00000000) goto yy85;
1237
+ if (yych == '}') goto yy244;
1238
+ goto yy175;
1239
+ yy177:
1240
+ skip(state);
1241
+ yych = peek(state);
1242
+ if (yych <= 0x00000000) goto yy85;
1243
+ if (yych == '|') goto yy246;
1244
+ goto yy177;
1245
+ yy179:
1246
+ yyaccept = 6;
1247
+ skip(state);
1248
+ backup = *state;
1249
+ yych = peek(state);
1250
+ if (yych <= '\'') {
1251
+ if (yych <= 0x00000000) goto yy98;
1252
+ if (yych <= '&') goto yy95;
1253
+ goto yy97;
1254
+ } else {
1255
+ if (yych == '\\') goto yy99;
1256
+ goto yy95;
1257
+ }
1258
+ yy180:
1259
+ skip(state);
1260
+ #line 39 "ext/rbs_extension/lexer.re"
1261
+ { return next_token(state, pDOT3); }
1262
+ #line 1263 "ext/rbs_extension/lexer.c"
1263
+ yy182:
1264
+ skip(state);
1265
+ yy183:
1266
+ #line 101 "ext/rbs_extension/lexer.re"
1267
+ { return next_token(state, tDQSYMBOL); }
1268
+ #line 1269 "ext/rbs_extension/lexer.c"
1269
+ yy184:
1270
+ skip(state);
1271
+ yych = peek(state);
1272
+ if (yych <= '"') {
1273
+ if (yych <= 0x00000000) goto yy85;
1274
+ if (yych <= '!') goto yy108;
1275
+ goto yy248;
1276
+ } else {
1277
+ if (yych == '\\') goto yy184;
1278
+ goto yy108;
1279
+ }
1280
+ yy186:
1281
+ skip(state);
1282
+ yych = peek(state);
1283
+ if (yych <= ',') {
1284
+ if (yych <= '\f') {
1285
+ if (yych <= 0x00000000) goto yy188;
1286
+ if (yych <= 0x00000008) goto yy186;
1287
+ if (yych >= '\v') goto yy186;
1288
+ } else {
1289
+ if (yych <= 0x0000001F) {
1290
+ if (yych >= 0x0000000E) goto yy186;
1291
+ } else {
1292
+ if (yych == '#') goto yy186;
1293
+ }
1294
+ }
1295
+ } else {
1296
+ if (yych <= '>') {
1297
+ if (yych <= '-') goto yy186;
1298
+ if (yych <= '/') goto yy188;
1299
+ if (yych <= '9') goto yy186;
1300
+ } else {
1301
+ if (yych <= '^') {
1302
+ if (yych <= 'Z') goto yy186;
1303
+ } else {
1304
+ if (yych <= 'z') goto yy186;
1305
+ if (yych >= 0x0000007F) goto yy186;
1306
+ }
1307
+ }
1308
+ }
1309
+ yy188:
1310
+ #line 118 "ext/rbs_extension/lexer.re"
1311
+ { return next_token(state, tSYMBOL); }
1312
+ #line 1313 "ext/rbs_extension/lexer.c"
1313
+ yy189:
1314
+ skip(state);
1315
+ goto yy188;
1316
+ yy190:
1317
+ skip(state);
1318
+ yy191:
1319
+ #line 102 "ext/rbs_extension/lexer.re"
1320
+ { return next_token(state, tSQSYMBOL); }
1321
+ #line 1322 "ext/rbs_extension/lexer.c"
1322
+ yy192:
1323
+ skip(state);
1324
+ yych = peek(state);
1325
+ if (yych <= '\'') {
1326
+ if (yych <= 0x00000000) goto yy85;
1327
+ if (yych <= '&') goto yy112;
1328
+ goto yy249;
1329
+ } else {
1330
+ if (yych == '\\') goto yy192;
1331
+ goto yy112;
1332
+ }
1333
+ yy194:
1334
+ skip(state);
1335
+ yych = peek(state);
1336
+ if (yych == '>') goto yy111;
1337
+ goto yy107;
1338
+ yy195:
1339
+ skip(state);
1340
+ yych = peek(state);
1341
+ if (yych == '=') goto yy111;
1342
+ goto yy107;
1343
+ yy196:
1344
+ skip(state);
1345
+ yych = peek(state);
1346
+ if (yych <= '^') {
1347
+ if (yych <= '@') goto yy85;
1348
+ if (yych <= 'Z') goto yy250;
1349
+ goto yy85;
1350
+ } else {
1351
+ if (yych == '`') goto yy85;
1352
+ if (yych <= 'z') goto yy250;
1353
+ goto yy85;
1354
+ }
1355
+ yy197:
1356
+ skip(state);
1357
+ yych = peek(state);
1358
+ if (yych <= '>') {
1359
+ if (yych <= '/') {
1360
+ if (yych == '!') goto yy253;
1361
+ } else {
1362
+ if (yych <= '9') goto yy197;
1363
+ if (yych == '=') goto yy253;
1364
+ }
1365
+ } else {
1366
+ if (yych <= '^') {
1367
+ if (yych <= '?') goto yy253;
1368
+ if (yych <= '@') goto yy199;
1369
+ if (yych <= 'Z') goto yy197;
1370
+ } else {
1371
+ if (yych == '`') goto yy199;
1372
+ if (yych <= 'z') goto yy197;
1373
+ }
1374
+ }
1375
+ yy199:
1376
+ #line 116 "ext/rbs_extension/lexer.re"
1377
+ { return next_token(state, tSYMBOL); }
1378
+ #line 1379 "ext/rbs_extension/lexer.c"
1379
+ yy200:
1380
+ skip(state);
1381
+ goto yy124;
1382
+ yy201:
1383
+ skip(state);
1384
+ yych = peek(state);
1385
+ if (yych <= 'Z') {
1386
+ if (yych <= '/') goto yy203;
1387
+ if (yych <= '9') goto yy201;
1388
+ if (yych >= 'A') goto yy201;
1389
+ } else {
1390
+ if (yych <= '_') {
1391
+ if (yych >= '_') goto yy201;
1392
+ } else {
1393
+ if (yych <= '`') goto yy203;
1394
+ if (yych <= 'z') goto yy201;
1395
+ }
1396
+ }
1397
+ yy203:
1398
+ #line 130 "ext/rbs_extension/lexer.re"
1399
+ { return next_token(state, tA2IDENT); }
1400
+ #line 1401 "ext/rbs_extension/lexer.c"
1401
+ yy204:
1402
+ skip(state);
1403
+ #line 41 "ext/rbs_extension/lexer.re"
1404
+ { return next_token(state, tQIDENT); }
1405
+ #line 1406 "ext/rbs_extension/lexer.c"
1406
+ yy206:
1407
+ skip(state);
1408
+ yych = peek(state);
1409
+ if (yych == 'a') goto yy254;
1410
+ goto yy67;
1411
+ yy207:
1412
+ skip(state);
1413
+ yych = peek(state);
1414
+ if (yych == 'r') goto yy255;
1415
+ goto yy67;
1416
+ yy208:
1417
+ skip(state);
1418
+ yych = peek(state);
1419
+ if (yych == 'l') goto yy256;
1420
+ goto yy67;
1421
+ yy209:
1422
+ skip(state);
1423
+ yych = peek(state);
1424
+ if (yych <= '=') {
1425
+ if (yych <= '/') {
1426
+ if (yych == '!') goto yy134;
1427
+ } else {
1428
+ if (yych <= '9') goto yy66;
1429
+ if (yych >= '=') goto yy136;
1430
+ }
1431
+ } else {
1432
+ if (yych <= '^') {
1433
+ if (yych <= '@') goto yy210;
1434
+ if (yych <= 'Z') goto yy66;
1435
+ } else {
1436
+ if (yych == '`') goto yy210;
1437
+ if (yych <= 'z') goto yy66;
1438
+ }
1439
+ }
1440
+ yy210:
1441
+ #line 71 "ext/rbs_extension/lexer.re"
1442
+ { return next_token(state, kBOT); }
1443
+ #line 1444 "ext/rbs_extension/lexer.c"
1444
+ yy211:
1445
+ skip(state);
1446
+ yych = peek(state);
1447
+ if (yych == 's') goto yy258;
1448
+ goto yy67;
1449
+ yy212:
1450
+ skip(state);
1451
+ yych = peek(state);
1452
+ if (yych <= '=') {
1453
+ if (yych <= '/') {
1454
+ if (yych == '!') goto yy134;
1455
+ } else {
1456
+ if (yych <= '9') goto yy66;
1457
+ if (yych >= '=') goto yy136;
1458
+ }
1459
+ } else {
1460
+ if (yych <= '^') {
1461
+ if (yych <= '@') goto yy213;
1462
+ if (yych <= 'Z') goto yy66;
1463
+ } else {
1464
+ if (yych == '`') goto yy213;
1465
+ if (yych <= 'z') goto yy66;
1466
+ }
1467
+ }
1468
+ yy213:
1469
+ #line 73 "ext/rbs_extension/lexer.re"
1470
+ { return next_token(state, kDEF); }
1471
+ #line 1472 "ext/rbs_extension/lexer.c"
1472
+ yy214:
1473
+ skip(state);
1474
+ yych = peek(state);
1475
+ if (yych <= '=') {
1476
+ if (yych <= '/') {
1477
+ if (yych == '!') goto yy134;
1478
+ } else {
1479
+ if (yych <= '9') goto yy66;
1480
+ if (yych >= '=') goto yy136;
1481
+ }
1482
+ } else {
1483
+ if (yych <= '^') {
1484
+ if (yych <= '@') goto yy215;
1485
+ if (yych <= 'Z') goto yy66;
1486
+ } else {
1487
+ if (yych == '`') goto yy215;
1488
+ if (yych <= 'z') goto yy66;
1489
+ }
1490
+ }
1491
+ yy215:
1492
+ #line 74 "ext/rbs_extension/lexer.re"
1493
+ { return next_token(state, kEND); }
1494
+ #line 1495 "ext/rbs_extension/lexer.c"
1495
+ yy216:
1496
+ skip(state);
1497
+ yych = peek(state);
1498
+ if (yych == 'e') goto yy259;
1499
+ goto yy67;
1500
+ yy217:
1501
+ skip(state);
1502
+ yych = peek(state);
1503
+ if (yych == 's') goto yy260;
1504
+ goto yy67;
1505
+ yy218:
1506
+ skip(state);
1507
+ yych = peek(state);
1508
+ if (yych == 'l') goto yy261;
1509
+ goto yy67;
1510
+ yy219:
1511
+ skip(state);
1512
+ yych = peek(state);
1513
+ if (yych == 't') goto yy262;
1514
+ goto yy67;
1515
+ yy220:
1516
+ skip(state);
1517
+ yych = peek(state);
1518
+ if (yych == 'e') goto yy263;
1519
+ goto yy67;
1520
+ yy221:
1521
+ skip(state);
1522
+ yych = peek(state);
1523
+ if (yych == 'u') goto yy264;
1524
+ goto yy67;
1525
+ yy222:
1526
+ skip(state);
1527
+ yych = peek(state);
1528
+ if (yych <= '=') {
1529
+ if (yych <= '/') {
1530
+ if (yych == '!') goto yy134;
1531
+ } else {
1532
+ if (yych <= '9') goto yy66;
1533
+ if (yych >= '=') goto yy136;
1534
+ }
1535
+ } else {
1536
+ if (yych <= '^') {
1537
+ if (yych <= '@') goto yy223;
1538
+ if (yych <= 'Z') goto yy66;
1539
+ } else {
1540
+ if (yych == '`') goto yy223;
1541
+ if (yych <= 'z') goto yy66;
1542
+ }
1543
+ }
1544
+ yy223:
1545
+ #line 82 "ext/rbs_extension/lexer.re"
1546
+ { return next_token(state, kNIL); }
1547
+ #line 1548 "ext/rbs_extension/lexer.c"
1548
+ yy224:
1549
+ skip(state);
1550
+ yych = peek(state);
1551
+ if (yych <= '=') {
1552
+ if (yych <= '/') {
1553
+ if (yych == '!') goto yy134;
1554
+ } else {
1555
+ if (yych <= '9') goto yy66;
1556
+ if (yych >= '=') goto yy136;
1557
+ }
1558
+ } else {
1559
+ if (yych <= '^') {
1560
+ if (yych <= '@') goto yy225;
1561
+ if (yych <= 'Z') goto yy66;
1562
+ } else {
1563
+ if (yych == '`') goto yy225;
1564
+ if (yych <= 'z') goto yy66;
1565
+ }
1566
+ }
1567
+ yy225:
1568
+ #line 83 "ext/rbs_extension/lexer.re"
1569
+ { return next_token(state, kOUT); }
1570
+ #line 1571 "ext/rbs_extension/lexer.c"
1571
+ yy226:
1572
+ skip(state);
1573
+ yych = peek(state);
1574
+ if (yych == 'p') goto yy265;
1575
+ goto yy67;
1576
+ yy227:
1577
+ skip(state);
1578
+ yych = peek(state);
1579
+ if (yych == 'v') goto yy266;
1580
+ goto yy67;
1581
+ yy228:
1582
+ skip(state);
1583
+ yych = peek(state);
1584
+ if (yych == 'l') goto yy267;
1585
+ goto yy67;
1586
+ yy229:
1587
+ skip(state);
1588
+ yych = peek(state);
1589
+ if (yych == 'f') goto yy268;
1590
+ goto yy67;
1591
+ yy230:
1592
+ skip(state);
1593
+ yych = peek(state);
1594
+ if (yych == 'g') goto yy270;
1595
+ goto yy67;
1596
+ yy231:
1597
+ skip(state);
1598
+ yych = peek(state);
1599
+ if (yych <= '=') {
1600
+ if (yych <= '/') {
1601
+ if (yych == '!') goto yy134;
1602
+ } else {
1603
+ if (yych <= '9') goto yy66;
1604
+ if (yych >= '=') goto yy136;
1605
+ }
1606
+ } else {
1607
+ if (yych <= '^') {
1608
+ if (yych <= '@') goto yy232;
1609
+ if (yych <= 'Z') goto yy66;
1610
+ } else {
1611
+ if (yych == '`') goto yy232;
1612
+ if (yych <= 'z') goto yy66;
1613
+ }
1614
+ }
1615
+ yy232:
1616
+ #line 89 "ext/rbs_extension/lexer.re"
1617
+ { return next_token(state, kTOP); }
1618
+ #line 1619 "ext/rbs_extension/lexer.c"
1619
+ yy233:
1620
+ skip(state);
1621
+ yych = peek(state);
1622
+ if (yych == 'e') goto yy271;
1623
+ goto yy67;
1624
+ yy234:
1625
+ skip(state);
1626
+ yych = peek(state);
1627
+ if (yych == 'e') goto yy273;
1628
+ goto yy67;
1629
+ yy235:
1630
+ skip(state);
1631
+ yych = peek(state);
1632
+ if (yych == 'h') goto yy275;
1633
+ goto yy67;
1634
+ yy236:
1635
+ skip(state);
1636
+ yych = peek(state);
1637
+ if (yych == 'y') goto yy276;
1638
+ goto yy67;
1639
+ yy237:
1640
+ skip(state);
1641
+ yych = peek(state);
1642
+ if (yych == 'd') goto yy277;
1643
+ goto yy67;
1644
+ yy238:
1645
+ skip(state);
1646
+ #line 54 "ext/rbs_extension/lexer.re"
1647
+ { return next_token(state, tANNOTATION); }
1648
+ #line 1649 "ext/rbs_extension/lexer.c"
1649
+ yy240:
1650
+ skip(state);
1651
+ #line 57 "ext/rbs_extension/lexer.re"
1652
+ { return next_token(state, tANNOTATION); }
1653
+ #line 1654 "ext/rbs_extension/lexer.c"
1654
+ yy242:
1655
+ skip(state);
1656
+ #line 55 "ext/rbs_extension/lexer.re"
1657
+ { return next_token(state, tANNOTATION); }
1658
+ #line 1659 "ext/rbs_extension/lexer.c"
1659
+ yy244:
1660
+ skip(state);
1661
+ #line 53 "ext/rbs_extension/lexer.re"
1662
+ { return next_token(state, tANNOTATION); }
1663
+ #line 1664 "ext/rbs_extension/lexer.c"
1664
+ yy246:
1665
+ skip(state);
1666
+ #line 56 "ext/rbs_extension/lexer.re"
1667
+ { return next_token(state, tANNOTATION); }
1668
+ #line 1669 "ext/rbs_extension/lexer.c"
1669
+ yy248:
1670
+ yyaccept = 7;
1671
+ skip(state);
1672
+ backup = *state;
1673
+ yych = peek(state);
1674
+ if (yych <= '"') {
1675
+ if (yych <= 0x00000000) goto yy183;
1676
+ if (yych <= '!') goto yy108;
1677
+ goto yy182;
1678
+ } else {
1679
+ if (yych == '\\') goto yy184;
1680
+ goto yy108;
1681
+ }
1682
+ yy249:
1683
+ yyaccept = 8;
1684
+ skip(state);
1685
+ backup = *state;
1686
+ yych = peek(state);
1687
+ if (yych <= '\'') {
1688
+ if (yych <= 0x00000000) goto yy191;
1689
+ if (yych <= '&') goto yy112;
1690
+ goto yy190;
1691
+ } else {
1692
+ if (yych == '\\') goto yy192;
1693
+ goto yy112;
1694
+ }
1695
+ yy250:
1696
+ skip(state);
1697
+ yych = peek(state);
1698
+ if (yych <= '>') {
1699
+ if (yych <= '/') {
1700
+ if (yych == '!') goto yy279;
1701
+ } else {
1702
+ if (yych <= '9') goto yy250;
1703
+ if (yych == '=') goto yy279;
1704
+ }
1705
+ } else {
1706
+ if (yych <= '^') {
1707
+ if (yych <= '?') goto yy279;
1708
+ if (yych <= '@') goto yy252;
1709
+ if (yych <= 'Z') goto yy250;
1710
+ } else {
1711
+ if (yych == '`') goto yy252;
1712
+ if (yych <= 'z') goto yy250;
1713
+ }
1714
+ }
1715
+ yy252:
1716
+ #line 117 "ext/rbs_extension/lexer.re"
1717
+ { return next_token(state, tSYMBOL); }
1718
+ #line 1719 "ext/rbs_extension/lexer.c"
1719
+ yy253:
1720
+ skip(state);
1721
+ goto yy199;
1722
+ yy254:
1723
+ skip(state);
1724
+ yych = peek(state);
1725
+ if (yych == 's') goto yy280;
1726
+ goto yy67;
1727
+ yy255:
1728
+ skip(state);
1729
+ yych = peek(state);
1730
+ if (yych == '_') goto yy282;
1731
+ goto yy67;
1732
+ yy256:
1733
+ skip(state);
1734
+ yych = peek(state);
1735
+ if (yych <= '=') {
1736
+ if (yych <= '/') {
1737
+ if (yych == '!') goto yy134;
1738
+ } else {
1739
+ if (yych <= '9') goto yy66;
1740
+ if (yych >= '=') goto yy136;
1741
+ }
1742
+ } else {
1743
+ if (yych <= '^') {
1744
+ if (yych <= '@') goto yy257;
1745
+ if (yych <= 'Z') goto yy66;
1746
+ } else {
1747
+ if (yych == '`') goto yy257;
1748
+ if (yych <= 'z') goto yy66;
1749
+ }
1750
+ }
1751
+ yy257:
1752
+ #line 70 "ext/rbs_extension/lexer.re"
1753
+ { return next_token(state, kBOOL); }
1754
+ #line 1755 "ext/rbs_extension/lexer.c"
1755
+ yy258:
1756
+ skip(state);
1757
+ yych = peek(state);
1758
+ if (yych == 's') goto yy283;
1759
+ goto yy67;
1760
+ yy259:
1761
+ skip(state);
1762
+ yych = peek(state);
1763
+ if (yych == 'n') goto yy285;
1764
+ goto yy67;
1765
+ yy260:
1766
+ skip(state);
1767
+ yych = peek(state);
1768
+ if (yych == 'e') goto yy286;
1769
+ goto yy67;
1770
+ yy261:
1771
+ skip(state);
1772
+ yych = peek(state);
1773
+ if (yych == 'u') goto yy288;
1774
+ goto yy67;
1775
+ yy262:
1776
+ skip(state);
1777
+ yych = peek(state);
1778
+ if (yych == 'a') goto yy289;
1779
+ goto yy67;
1780
+ yy263:
1781
+ skip(state);
1782
+ yych = peek(state);
1783
+ if (yych == 'r') goto yy290;
1784
+ goto yy67;
1785
+ yy264:
1786
+ skip(state);
1787
+ yych = peek(state);
1788
+ if (yych == 'l') goto yy291;
1789
+ goto yy67;
1790
+ yy265:
1791
+ skip(state);
1792
+ yych = peek(state);
1793
+ if (yych == 'e') goto yy292;
1794
+ goto yy67;
1795
+ yy266:
1796
+ skip(state);
1797
+ yych = peek(state);
1798
+ if (yych == 'a') goto yy293;
1799
+ goto yy67;
1800
+ yy267:
1801
+ skip(state);
1802
+ yych = peek(state);
1803
+ if (yych == 'i') goto yy294;
1804
+ goto yy67;
1805
+ yy268:
1806
+ skip(state);
1807
+ yych = peek(state);
1808
+ if (yych <= '=') {
1809
+ if (yych <= '/') {
1810
+ if (yych == '!') goto yy134;
1811
+ } else {
1812
+ if (yych <= '9') goto yy66;
1813
+ if (yych >= '=') goto yy136;
1814
+ }
1815
+ } else {
1816
+ if (yych <= '^') {
1817
+ if (yych <= '@') goto yy269;
1818
+ if (yych <= 'Z') goto yy66;
1819
+ } else {
1820
+ if (yych == '`') goto yy269;
1821
+ if (yych <= 'z') goto yy66;
1822
+ }
1823
+ }
1824
+ yy269:
1825
+ #line 87 "ext/rbs_extension/lexer.re"
1826
+ { return next_token(state, kSELF); }
1827
+ #line 1828 "ext/rbs_extension/lexer.c"
1828
+ yy270:
1829
+ skip(state);
1830
+ yych = peek(state);
1831
+ if (yych == 'l') goto yy295;
1832
+ goto yy67;
1833
+ yy271:
1834
+ skip(state);
1835
+ yych = peek(state);
1836
+ if (yych <= '=') {
1837
+ if (yych <= '/') {
1838
+ if (yych == '!') goto yy134;
1839
+ } else {
1840
+ if (yych <= '9') goto yy66;
1841
+ if (yych >= '=') goto yy136;
1842
+ }
1843
+ } else {
1844
+ if (yych <= '^') {
1845
+ if (yych <= '@') goto yy272;
1846
+ if (yych <= 'Z') goto yy66;
1847
+ } else {
1848
+ if (yych == '`') goto yy272;
1849
+ if (yych <= 'z') goto yy66;
1850
+ }
1851
+ }
1852
+ yy272:
1853
+ #line 90 "ext/rbs_extension/lexer.re"
1854
+ { return next_token(state, kTRUE); }
1855
+ #line 1856 "ext/rbs_extension/lexer.c"
1856
+ yy273:
1857
+ skip(state);
1858
+ yych = peek(state);
1859
+ if (yych <= '=') {
1860
+ if (yych <= '/') {
1861
+ if (yych == '!') goto yy134;
1862
+ } else {
1863
+ if (yych <= '9') goto yy66;
1864
+ if (yych >= '=') goto yy136;
1865
+ }
1866
+ } else {
1867
+ if (yych <= '^') {
1868
+ if (yych <= '@') goto yy274;
1869
+ if (yych <= 'Z') goto yy66;
1870
+ } else {
1871
+ if (yych == '`') goto yy274;
1872
+ if (yych <= 'z') goto yy66;
1873
+ }
1874
+ }
1875
+ yy274:
1876
+ #line 91 "ext/rbs_extension/lexer.re"
1877
+ { return next_token(state, kTYPE); }
1878
+ #line 1879 "ext/rbs_extension/lexer.c"
1879
+ yy275:
1880
+ skip(state);
1881
+ yych = peek(state);
1882
+ if (yych == 'e') goto yy296;
1883
+ goto yy67;
1884
+ yy276:
1885
+ skip(state);
1886
+ yych = peek(state);
1887
+ if (yych == 'p') goto yy297;
1888
+ goto yy67;
1889
+ yy277:
1890
+ skip(state);
1891
+ yych = peek(state);
1892
+ if (yych <= '=') {
1893
+ if (yych <= '/') {
1894
+ if (yych == '!') goto yy134;
1895
+ } else {
1896
+ if (yych <= '9') goto yy66;
1897
+ if (yych >= '=') goto yy136;
1898
+ }
1899
+ } else {
1900
+ if (yych <= '^') {
1901
+ if (yych <= '@') goto yy278;
1902
+ if (yych <= 'Z') goto yy66;
1903
+ } else {
1904
+ if (yych == '`') goto yy278;
1905
+ if (yych <= 'z') goto yy66;
1906
+ }
1907
+ }
1908
+ yy278:
1909
+ #line 94 "ext/rbs_extension/lexer.re"
1910
+ { return next_token(state, kVOID); }
1911
+ #line 1912 "ext/rbs_extension/lexer.c"
1912
+ yy279:
1913
+ skip(state);
1914
+ goto yy252;
1915
+ yy280:
1916
+ skip(state);
1917
+ yych = peek(state);
1918
+ if (yych <= '=') {
1919
+ if (yych <= '/') {
1920
+ if (yych == '!') goto yy134;
1921
+ } else {
1922
+ if (yych <= '9') goto yy66;
1923
+ if (yych >= '=') goto yy136;
1924
+ }
1925
+ } else {
1926
+ if (yych <= '^') {
1927
+ if (yych <= '@') goto yy281;
1928
+ if (yych <= 'Z') goto yy66;
1929
+ } else {
1930
+ if (yych == '`') goto yy281;
1931
+ if (yych <= 'z') goto yy66;
1932
+ }
1933
+ }
1934
+ yy281:
1935
+ #line 66 "ext/rbs_extension/lexer.re"
1936
+ { return next_token(state, kALIAS); }
1937
+ #line 1938 "ext/rbs_extension/lexer.c"
1938
+ yy282:
1939
+ skip(state);
1940
+ yych = peek(state);
1941
+ if (yych <= 'q') {
1942
+ if (yych == 'a') goto yy298;
1943
+ goto yy67;
1944
+ } else {
1945
+ if (yych <= 'r') goto yy299;
1946
+ if (yych == 'w') goto yy300;
1947
+ goto yy67;
1948
+ }
1949
+ yy283:
1950
+ skip(state);
1951
+ yych = peek(state);
1952
+ if (yych <= '=') {
1953
+ if (yych <= '/') {
1954
+ if (yych == '!') goto yy134;
1955
+ } else {
1956
+ if (yych <= '9') goto yy66;
1957
+ if (yych >= '=') goto yy136;
1958
+ }
1959
+ } else {
1960
+ if (yych <= '^') {
1961
+ if (yych <= '@') goto yy284;
1962
+ if (yych <= 'Z') goto yy66;
1963
+ } else {
1964
+ if (yych == '`') goto yy284;
1965
+ if (yych <= 'z') goto yy66;
1966
+ }
1967
+ }
1968
+ yy284:
1969
+ #line 72 "ext/rbs_extension/lexer.re"
1970
+ { return next_token(state, kCLASS); }
1971
+ #line 1972 "ext/rbs_extension/lexer.c"
1972
+ yy285:
1973
+ skip(state);
1974
+ yych = peek(state);
1975
+ if (yych == 'd') goto yy301;
1976
+ goto yy67;
1977
+ yy286:
1978
+ skip(state);
1979
+ yych = peek(state);
1980
+ if (yych <= '=') {
1981
+ if (yych <= '/') {
1982
+ if (yych == '!') goto yy134;
1983
+ } else {
1984
+ if (yych <= '9') goto yy66;
1985
+ if (yych >= '=') goto yy136;
1986
+ }
1987
+ } else {
1988
+ if (yych <= '^') {
1989
+ if (yych <= '@') goto yy287;
1990
+ if (yych <= 'Z') goto yy66;
1991
+ } else {
1992
+ if (yych == '`') goto yy287;
1993
+ if (yych <= 'z') goto yy66;
1994
+ }
1995
+ }
1996
+ yy287:
1997
+ #line 76 "ext/rbs_extension/lexer.re"
1998
+ { return next_token(state, kFALSE); }
1999
+ #line 2000 "ext/rbs_extension/lexer.c"
2000
+ yy288:
2001
+ skip(state);
2002
+ yych = peek(state);
2003
+ if (yych == 'd') goto yy303;
2004
+ goto yy67;
2005
+ yy289:
2006
+ skip(state);
2007
+ yych = peek(state);
2008
+ if (yych == 'n') goto yy304;
2009
+ goto yy67;
2010
+ yy290:
2011
+ skip(state);
2012
+ yych = peek(state);
2013
+ if (yych == 'f') goto yy305;
2014
+ goto yy67;
2015
+ yy291:
2016
+ skip(state);
2017
+ yych = peek(state);
2018
+ if (yych == 'e') goto yy306;
2019
+ goto yy67;
2020
+ yy292:
2021
+ skip(state);
2022
+ yych = peek(state);
2023
+ if (yych == 'n') goto yy308;
2024
+ goto yy67;
2025
+ yy293:
2026
+ skip(state);
2027
+ yych = peek(state);
2028
+ if (yych == 't') goto yy309;
2029
+ goto yy67;
2030
+ yy294:
2031
+ skip(state);
2032
+ yych = peek(state);
2033
+ if (yych == 'c') goto yy310;
2034
+ goto yy67;
2035
+ yy295:
2036
+ skip(state);
2037
+ yych = peek(state);
2038
+ if (yych == 'e') goto yy312;
2039
+ goto yy67;
2040
+ yy296:
2041
+ skip(state);
2042
+ yych = peek(state);
2043
+ if (yych == 'c') goto yy313;
2044
+ goto yy67;
2045
+ yy297:
2046
+ skip(state);
2047
+ yych = peek(state);
2048
+ if (yych == 'e') goto yy314;
2049
+ goto yy67;
2050
+ yy298:
2051
+ skip(state);
2052
+ yych = peek(state);
2053
+ if (yych == 'c') goto yy315;
2054
+ goto yy67;
2055
+ yy299:
2056
+ skip(state);
2057
+ yych = peek(state);
2058
+ if (yych == 'e') goto yy316;
2059
+ goto yy67;
2060
+ yy300:
2061
+ skip(state);
2062
+ yych = peek(state);
2063
+ if (yych == 'r') goto yy317;
2064
+ goto yy67;
2065
+ yy301:
2066
+ skip(state);
2067
+ yych = peek(state);
2068
+ if (yych <= '=') {
2069
+ if (yych <= '/') {
2070
+ if (yych == '!') goto yy134;
2071
+ } else {
2072
+ if (yych <= '9') goto yy66;
2073
+ if (yych >= '=') goto yy136;
2074
+ }
2075
+ } else {
2076
+ if (yych <= '^') {
2077
+ if (yych <= '@') goto yy302;
2078
+ if (yych <= 'Z') goto yy66;
2079
+ } else {
2080
+ if (yych == '`') goto yy302;
2081
+ if (yych <= 'z') goto yy66;
2082
+ }
2083
+ }
2084
+ yy302:
2085
+ #line 75 "ext/rbs_extension/lexer.re"
2086
+ { return next_token(state, kEXTEND); }
2087
+ #line 2088 "ext/rbs_extension/lexer.c"
2088
+ yy303:
2089
+ skip(state);
2090
+ yych = peek(state);
2091
+ if (yych == 'e') goto yy318;
2092
+ goto yy67;
2093
+ yy304:
2094
+ skip(state);
2095
+ yych = peek(state);
2096
+ if (yych == 'c') goto yy320;
2097
+ goto yy67;
2098
+ yy305:
2099
+ skip(state);
2100
+ yych = peek(state);
2101
+ if (yych == 'a') goto yy321;
2102
+ goto yy67;
2103
+ yy306:
2104
+ skip(state);
2105
+ yych = peek(state);
2106
+ if (yych <= '=') {
2107
+ if (yych <= '/') {
2108
+ if (yych == '!') goto yy134;
2109
+ } else {
2110
+ if (yych <= '9') goto yy66;
2111
+ if (yych >= '=') goto yy136;
2112
+ }
2113
+ } else {
2114
+ if (yych <= '^') {
2115
+ if (yych <= '@') goto yy307;
2116
+ if (yych <= 'Z') goto yy66;
2117
+ } else {
2118
+ if (yych == '`') goto yy307;
2119
+ if (yych <= 'z') goto yy66;
2120
+ }
2121
+ }
2122
+ yy307:
2123
+ #line 81 "ext/rbs_extension/lexer.re"
2124
+ { return next_token(state, kMODULE); }
2125
+ #line 2126 "ext/rbs_extension/lexer.c"
2126
+ yy308:
2127
+ skip(state);
2128
+ yych = peek(state);
2129
+ if (yych == 'd') goto yy322;
2130
+ goto yy67;
2131
+ yy309:
2132
+ skip(state);
2133
+ yych = peek(state);
2134
+ if (yych == 'e') goto yy324;
2135
+ goto yy67;
2136
+ yy310:
2137
+ skip(state);
2138
+ yych = peek(state);
2139
+ if (yych <= '=') {
2140
+ if (yych <= '/') {
2141
+ if (yych == '!') goto yy134;
2142
+ } else {
2143
+ if (yych <= '9') goto yy66;
2144
+ if (yych >= '=') goto yy136;
2145
+ }
2146
+ } else {
2147
+ if (yych <= '^') {
2148
+ if (yych <= '@') goto yy311;
2149
+ if (yych <= 'Z') goto yy66;
2150
+ } else {
2151
+ if (yych == '`') goto yy311;
2152
+ if (yych <= 'z') goto yy66;
2153
+ }
2154
+ }
2155
+ yy311:
2156
+ #line 86 "ext/rbs_extension/lexer.re"
2157
+ { return next_token(state, kPUBLIC); }
2158
+ #line 2159 "ext/rbs_extension/lexer.c"
2159
+ yy312:
2160
+ skip(state);
2161
+ yych = peek(state);
2162
+ if (yych == 't') goto yy326;
2163
+ goto yy67;
2164
+ yy313:
2165
+ skip(state);
2166
+ yych = peek(state);
2167
+ if (yych == 'k') goto yy327;
2168
+ goto yy67;
2169
+ yy314:
2170
+ skip(state);
2171
+ yych = peek(state);
2172
+ if (yych == 'd') goto yy328;
2173
+ goto yy67;
2174
+ yy315:
2175
+ skip(state);
2176
+ yych = peek(state);
2177
+ if (yych == 'c') goto yy330;
2178
+ goto yy67;
2179
+ yy316:
2180
+ skip(state);
2181
+ yych = peek(state);
2182
+ if (yych == 'a') goto yy331;
2183
+ goto yy67;
2184
+ yy317:
2185
+ skip(state);
2186
+ yych = peek(state);
2187
+ if (yych == 'i') goto yy332;
2188
+ goto yy67;
2189
+ yy318:
2190
+ skip(state);
2191
+ yych = peek(state);
2192
+ if (yych <= '=') {
2193
+ if (yych <= '/') {
2194
+ if (yych == '!') goto yy134;
2195
+ } else {
2196
+ if (yych <= '9') goto yy66;
2197
+ if (yych >= '=') goto yy136;
2198
+ }
2199
+ } else {
2200
+ if (yych <= '^') {
2201
+ if (yych <= '@') goto yy319;
2202
+ if (yych <= 'Z') goto yy66;
2203
+ } else {
2204
+ if (yych == '`') goto yy319;
2205
+ if (yych <= 'z') goto yy66;
2206
+ }
2207
+ }
2208
+ yy319:
2209
+ #line 78 "ext/rbs_extension/lexer.re"
2210
+ { return next_token(state, kINCLUDE); }
2211
+ #line 2212 "ext/rbs_extension/lexer.c"
2212
+ yy320:
2213
+ skip(state);
2214
+ yych = peek(state);
2215
+ if (yych == 'e') goto yy333;
2216
+ goto yy67;
2217
+ yy321:
2218
+ skip(state);
2219
+ yych = peek(state);
2220
+ if (yych == 'c') goto yy335;
2221
+ goto yy67;
2222
+ yy322:
2223
+ skip(state);
2224
+ yych = peek(state);
2225
+ if (yych <= '=') {
2226
+ if (yych <= '/') {
2227
+ if (yych == '!') goto yy134;
2228
+ } else {
2229
+ if (yych <= '9') goto yy66;
2230
+ if (yych >= '=') goto yy136;
2231
+ }
2232
+ } else {
2233
+ if (yych <= '^') {
2234
+ if (yych <= '@') goto yy323;
2235
+ if (yych <= 'Z') goto yy66;
2236
+ } else {
2237
+ if (yych == '`') goto yy323;
2238
+ if (yych <= 'z') goto yy66;
2239
+ }
2240
+ }
2241
+ yy323:
2242
+ #line 84 "ext/rbs_extension/lexer.re"
2243
+ { return next_token(state, kPREPEND); }
2244
+ #line 2245 "ext/rbs_extension/lexer.c"
2245
+ yy324:
2246
+ skip(state);
2247
+ yych = peek(state);
2248
+ if (yych <= '=') {
2249
+ if (yych <= '/') {
2250
+ if (yych == '!') goto yy134;
2251
+ } else {
2252
+ if (yych <= '9') goto yy66;
2253
+ if (yych >= '=') goto yy136;
2254
+ }
2255
+ } else {
2256
+ if (yych <= '^') {
2257
+ if (yych <= '@') goto yy325;
2258
+ if (yych <= 'Z') goto yy66;
2259
+ } else {
2260
+ if (yych == '`') goto yy325;
2261
+ if (yych <= 'z') goto yy66;
2262
+ }
2263
+ }
2264
+ yy325:
2265
+ #line 85 "ext/rbs_extension/lexer.re"
2266
+ { return next_token(state, kPRIVATE); }
2267
+ #line 2268 "ext/rbs_extension/lexer.c"
2268
+ yy326:
2269
+ skip(state);
2270
+ yych = peek(state);
2271
+ if (yych == 'o') goto yy336;
2272
+ goto yy67;
2273
+ yy327:
2274
+ skip(state);
2275
+ yych = peek(state);
2276
+ if (yych == 'e') goto yy337;
2277
+ goto yy67;
2278
+ yy328:
2279
+ skip(state);
2280
+ yych = peek(state);
2281
+ if (yych <= '=') {
2282
+ if (yych <= '/') {
2283
+ if (yych == '!') goto yy134;
2284
+ } else {
2285
+ if (yych <= '9') goto yy66;
2286
+ if (yych >= '=') goto yy136;
2287
+ }
2288
+ } else {
2289
+ if (yych <= '^') {
2290
+ if (yych <= '@') goto yy329;
2291
+ if (yych <= 'Z') goto yy66;
2292
+ } else {
2293
+ if (yych == '`') goto yy329;
2294
+ if (yych <= 'z') goto yy66;
2295
+ }
2296
+ }
2297
+ yy329:
2298
+ #line 93 "ext/rbs_extension/lexer.re"
2299
+ { return next_token(state, kUNTYPED); }
2300
+ #line 2301 "ext/rbs_extension/lexer.c"
2301
+ yy330:
2302
+ skip(state);
2303
+ yych = peek(state);
2304
+ if (yych == 'e') goto yy338;
2305
+ goto yy67;
2306
+ yy331:
2307
+ skip(state);
2308
+ yych = peek(state);
2309
+ if (yych == 'd') goto yy339;
2310
+ goto yy67;
2311
+ yy332:
2312
+ skip(state);
2313
+ yych = peek(state);
2314
+ if (yych == 't') goto yy340;
2315
+ goto yy67;
2316
+ yy333:
2317
+ skip(state);
2318
+ yych = peek(state);
2319
+ if (yych <= '=') {
2320
+ if (yych <= '/') {
2321
+ if (yych == '!') goto yy134;
2322
+ } else {
2323
+ if (yych <= '9') goto yy66;
2324
+ if (yych >= '=') goto yy136;
2325
+ }
2326
+ } else {
2327
+ if (yych <= '^') {
2328
+ if (yych <= '@') goto yy334;
2329
+ if (yych <= 'Z') goto yy66;
2330
+ } else {
2331
+ if (yych == '`') goto yy334;
2332
+ if (yych <= 'z') goto yy66;
2333
+ }
2334
+ }
2335
+ yy334:
2336
+ #line 79 "ext/rbs_extension/lexer.re"
2337
+ { return next_token(state, kINSTANCE); }
2338
+ #line 2339 "ext/rbs_extension/lexer.c"
2339
+ yy335:
2340
+ skip(state);
2341
+ yych = peek(state);
2342
+ if (yych == 'e') goto yy341;
2343
+ goto yy67;
2344
+ yy336:
2345
+ skip(state);
2346
+ yych = peek(state);
2347
+ if (yych == 'n') goto yy343;
2348
+ goto yy67;
2349
+ yy337:
2350
+ skip(state);
2351
+ yych = peek(state);
2352
+ if (yych == 'd') goto yy345;
2353
+ goto yy67;
2354
+ yy338:
2355
+ skip(state);
2356
+ yych = peek(state);
2357
+ if (yych == 's') goto yy347;
2358
+ goto yy67;
2359
+ yy339:
2360
+ skip(state);
2361
+ yych = peek(state);
2362
+ if (yych == 'e') goto yy348;
2363
+ goto yy67;
2364
+ yy340:
2365
+ skip(state);
2366
+ yych = peek(state);
2367
+ if (yych == 'e') goto yy349;
2368
+ goto yy67;
2369
+ yy341:
2370
+ skip(state);
2371
+ yych = peek(state);
2372
+ if (yych <= '=') {
2373
+ if (yych <= '/') {
2374
+ if (yych == '!') goto yy134;
2375
+ } else {
2376
+ if (yych <= '9') goto yy66;
2377
+ if (yych >= '=') goto yy136;
2378
+ }
2379
+ } else {
2380
+ if (yych <= '^') {
2381
+ if (yych <= '@') goto yy342;
2382
+ if (yych <= 'Z') goto yy66;
2383
+ } else {
2384
+ if (yych == '`') goto yy342;
2385
+ if (yych <= 'z') goto yy66;
2386
+ }
2387
+ }
2388
+ yy342:
2389
+ #line 80 "ext/rbs_extension/lexer.re"
2390
+ { return next_token(state, kINTERFACE); }
2391
+ #line 2392 "ext/rbs_extension/lexer.c"
2392
+ yy343:
2393
+ skip(state);
2394
+ yych = peek(state);
2395
+ if (yych <= '=') {
2396
+ if (yych <= '/') {
2397
+ if (yych == '!') goto yy134;
2398
+ } else {
2399
+ if (yych <= '9') goto yy66;
2400
+ if (yych >= '=') goto yy136;
2401
+ }
2402
+ } else {
2403
+ if (yych <= '^') {
2404
+ if (yych <= '@') goto yy344;
2405
+ if (yych <= 'Z') goto yy66;
2406
+ } else {
2407
+ if (yych == '`') goto yy344;
2408
+ if (yych <= 'z') goto yy66;
2409
+ }
2410
+ }
2411
+ yy344:
2412
+ #line 88 "ext/rbs_extension/lexer.re"
2413
+ { return next_token(state, kSINGLETON); }
2414
+ #line 2415 "ext/rbs_extension/lexer.c"
2415
+ yy345:
2416
+ skip(state);
2417
+ yych = peek(state);
2418
+ if (yych <= '=') {
2419
+ if (yych <= '/') {
2420
+ if (yych == '!') goto yy134;
2421
+ } else {
2422
+ if (yych <= '9') goto yy66;
2423
+ if (yych >= '=') goto yy136;
2424
+ }
2425
+ } else {
2426
+ if (yych <= '^') {
2427
+ if (yych <= '@') goto yy346;
2428
+ if (yych <= 'Z') goto yy66;
2429
+ } else {
2430
+ if (yych == '`') goto yy346;
2431
+ if (yych <= 'z') goto yy66;
2432
+ }
2433
+ }
2434
+ yy346:
2435
+ #line 92 "ext/rbs_extension/lexer.re"
2436
+ { return next_token(state, kUNCHECKED); }
2437
+ #line 2438 "ext/rbs_extension/lexer.c"
2438
+ yy347:
2439
+ skip(state);
2440
+ yych = peek(state);
2441
+ if (yych == 's') goto yy350;
2442
+ goto yy67;
2443
+ yy348:
2444
+ skip(state);
2445
+ yych = peek(state);
2446
+ if (yych == 'r') goto yy351;
2447
+ goto yy67;
2448
+ yy349:
2449
+ skip(state);
2450
+ yych = peek(state);
2451
+ if (yych == 'r') goto yy353;
2452
+ goto yy67;
2453
+ yy350:
2454
+ skip(state);
2455
+ yych = peek(state);
2456
+ if (yych == 'o') goto yy355;
2457
+ goto yy67;
2458
+ yy351:
2459
+ skip(state);
2460
+ yych = peek(state);
2461
+ if (yych <= '=') {
2462
+ if (yych <= '/') {
2463
+ if (yych == '!') goto yy134;
2464
+ } else {
2465
+ if (yych <= '9') goto yy66;
2466
+ if (yych >= '=') goto yy136;
2467
+ }
2468
+ } else {
2469
+ if (yych <= '^') {
2470
+ if (yych <= '@') goto yy352;
2471
+ if (yych <= 'Z') goto yy66;
2472
+ } else {
2473
+ if (yych == '`') goto yy352;
2474
+ if (yych <= 'z') goto yy66;
2475
+ }
2476
+ }
2477
+ yy352:
2478
+ #line 68 "ext/rbs_extension/lexer.re"
2479
+ { return next_token(state, kATTRREADER); }
2480
+ #line 2481 "ext/rbs_extension/lexer.c"
2481
+ yy353:
2482
+ skip(state);
2483
+ yych = peek(state);
2484
+ if (yych <= '=') {
2485
+ if (yych <= '/') {
2486
+ if (yych == '!') goto yy134;
2487
+ } else {
2488
+ if (yych <= '9') goto yy66;
2489
+ if (yych >= '=') goto yy136;
2490
+ }
2491
+ } else {
2492
+ if (yych <= '^') {
2493
+ if (yych <= '@') goto yy354;
2494
+ if (yych <= 'Z') goto yy66;
2495
+ } else {
2496
+ if (yych == '`') goto yy354;
2497
+ if (yych <= 'z') goto yy66;
2498
+ }
2499
+ }
2500
+ yy354:
2501
+ #line 69 "ext/rbs_extension/lexer.re"
2502
+ { return next_token(state, kATTRWRITER); }
2503
+ #line 2504 "ext/rbs_extension/lexer.c"
2504
+ yy355:
2505
+ skip(state);
2506
+ yych = peek(state);
2507
+ if (yych != 'r') goto yy67;
2508
+ skip(state);
2509
+ yych = peek(state);
2510
+ if (yych <= '=') {
2511
+ if (yych <= '/') {
2512
+ if (yych == '!') goto yy134;
2513
+ } else {
2514
+ if (yych <= '9') goto yy66;
2515
+ if (yych >= '=') goto yy136;
2516
+ }
2517
+ } else {
2518
+ if (yych <= '^') {
2519
+ if (yych <= '@') goto yy357;
2520
+ if (yych <= 'Z') goto yy66;
2521
+ } else {
2522
+ if (yych == '`') goto yy357;
2523
+ if (yych <= 'z') goto yy66;
2524
+ }
2525
+ }
2526
+ yy357:
2527
+ #line 67 "ext/rbs_extension/lexer.re"
2528
+ { return next_token(state, kATTRACCESSOR); }
2529
+ #line 2530 "ext/rbs_extension/lexer.c"
1066
2530
  }
2531
+ #line 139 "ext/rbs_extension/lexer.re"
1067
2532
 
1068
- char *peek_token(lexstate *state, token tok) {
1069
- return RSTRING_PTR(state->string) + tok.range.start.byte_pos;
1070
2533
  }