gherkin 2.4.18 → 2.4.20
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -7
- data/History.md +9 -0
- data/README.md +2 -2
- data/ext/gherkin_lexer_ar/extconf.rb +6 -0
- data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +1428 -0
- data/ext/gherkin_lexer_bg/extconf.rb +6 -0
- data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +1654 -0
- data/ext/gherkin_lexer_ca/extconf.rb +6 -0
- data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +1580 -0
- data/ext/gherkin_lexer_cs/extconf.rb +6 -0
- data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +1426 -0
- data/ext/gherkin_lexer_cy_gb/extconf.rb +6 -0
- data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +1281 -0
- data/ext/gherkin_lexer_da/extconf.rb +6 -0
- data/ext/gherkin_lexer_da/gherkin_lexer_da.c +1297 -0
- data/ext/gherkin_lexer_de/extconf.rb +6 -0
- data/ext/gherkin_lexer_de/gherkin_lexer_de.c +1414 -0
- data/ext/gherkin_lexer_en/extconf.rb +6 -0
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +1264 -0
- data/ext/gherkin_lexer_en_au/extconf.rb +6 -0
- data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +1225 -0
- data/ext/gherkin_lexer_en_lol/extconf.rb +6 -0
- data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +1174 -0
- data/ext/gherkin_lexer_en_pirate/extconf.rb +6 -0
- data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +1470 -0
- data/ext/gherkin_lexer_en_scouse/extconf.rb +6 -0
- data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +1631 -0
- data/ext/gherkin_lexer_en_tx/extconf.rb +6 -0
- data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +1264 -0
- data/ext/gherkin_lexer_eo/extconf.rb +6 -0
- data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +1240 -0
- data/ext/gherkin_lexer_es/extconf.rb +6 -0
- data/ext/gherkin_lexer_es/gherkin_lexer_es.c +1379 -0
- data/ext/gherkin_lexer_et/extconf.rb +6 -0
- data/ext/gherkin_lexer_et/gherkin_lexer_et.c +1235 -0
- data/ext/gherkin_lexer_fi/extconf.rb +6 -0
- data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +1214 -0
- data/ext/gherkin_lexer_fr/extconf.rb +6 -0
- data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +1450 -0
- data/ext/gherkin_lexer_he/extconf.rb +6 -0
- data/ext/gherkin_lexer_he/gherkin_lexer_he.c +1373 -0
- data/ext/gherkin_lexer_hr/extconf.rb +6 -0
- data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +1322 -0
- data/ext/gherkin_lexer_hu/extconf.rb +6 -0
- data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +1373 -0
- data/ext/gherkin_lexer_id/extconf.rb +6 -0
- data/ext/gherkin_lexer_id/gherkin_lexer_id.c +1207 -0
- data/ext/gherkin_lexer_is/extconf.rb +6 -0
- data/ext/gherkin_lexer_is/gherkin_lexer_is.c +1375 -0
- data/ext/gherkin_lexer_it/extconf.rb +6 -0
- data/ext/gherkin_lexer_it/gherkin_lexer_it.c +1331 -0
- data/ext/gherkin_lexer_ja/extconf.rb +6 -0
- data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +1698 -0
- data/ext/gherkin_lexer_ko/extconf.rb +6 -0
- data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +1359 -0
- data/ext/gherkin_lexer_lt/extconf.rb +6 -0
- data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +1294 -0
- data/ext/gherkin_lexer_lu/extconf.rb +6 -0
- data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +1388 -0
- data/ext/gherkin_lexer_lv/extconf.rb +6 -0
- data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +1424 -0
- data/ext/gherkin_lexer_nl/extconf.rb +6 -0
- data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +1367 -0
- data/ext/gherkin_lexer_no/extconf.rb +6 -0
- data/ext/gherkin_lexer_no/gherkin_lexer_no.c +1310 -0
- data/ext/gherkin_lexer_pl/extconf.rb +6 -0
- data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +1476 -0
- data/ext/gherkin_lexer_pt/extconf.rb +6 -0
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +1326 -0
- data/ext/gherkin_lexer_ro/extconf.rb +6 -0
- data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +1424 -0
- data/ext/gherkin_lexer_ru/extconf.rb +6 -0
- data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +2056 -0
- data/ext/gherkin_lexer_sk/extconf.rb +6 -0
- data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +1297 -0
- data/ext/gherkin_lexer_sr_cyrl/extconf.rb +6 -0
- data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +2111 -0
- data/ext/gherkin_lexer_sr_latn/extconf.rb +6 -0
- data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +1566 -0
- data/ext/gherkin_lexer_sv/extconf.rb +6 -0
- data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +1323 -0
- data/ext/gherkin_lexer_tr/extconf.rb +6 -0
- data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +1346 -0
- data/ext/gherkin_lexer_uk/extconf.rb +6 -0
- data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +1940 -0
- data/ext/gherkin_lexer_uz/extconf.rb +6 -0
- data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +1650 -0
- data/ext/gherkin_lexer_vi/extconf.rb +6 -0
- data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +1457 -0
- data/ext/gherkin_lexer_zh_cn/extconf.rb +6 -0
- data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +1222 -0
- data/ext/gherkin_lexer_zh_tw/extconf.rb +6 -0
- data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +1264 -0
- data/gherkin.gemspec +9 -3
- data/lib/gherkin/formatter/filter_formatter.rb +6 -1
- data/lib/gherkin/rb_lexer/ar.rb +1162 -0
- data/lib/gherkin/rb_lexer/bg.rb +1374 -0
- data/lib/gherkin/rb_lexer/ca.rb +1304 -0
- data/lib/gherkin/rb_lexer/cs.rb +1156 -0
- data/lib/gherkin/rb_lexer/cy_gb.rb +1026 -0
- data/lib/gherkin/rb_lexer/da.rb +1040 -0
- data/lib/gherkin/rb_lexer/de.rb +1150 -0
- data/lib/gherkin/rb_lexer/en.rb +1008 -0
- data/lib/gherkin/rb_lexer/en_au.rb +972 -0
- data/lib/gherkin/rb_lexer/en_lol.rb +927 -0
- data/lib/gherkin/rb_lexer/en_pirate.rb +1204 -0
- data/lib/gherkin/rb_lexer/en_scouse.rb +1355 -0
- data/lib/gherkin/rb_lexer/en_tx.rb +1010 -0
- data/lib/gherkin/rb_lexer/eo.rb +989 -0
- data/lib/gherkin/rb_lexer/es.rb +1116 -0
- data/lib/gherkin/rb_lexer/et.rb +982 -0
- data/lib/gherkin/rb_lexer/fi.rb +963 -0
- data/lib/gherkin/rb_lexer/fr.rb +1184 -0
- data/lib/gherkin/rb_lexer/he.rb +1110 -0
- data/lib/gherkin/rb_lexer/hr.rb +1060 -0
- data/lib/gherkin/rb_lexer/hu.rb +1111 -0
- data/lib/gherkin/rb_lexer/id.rb +957 -0
- data/lib/gherkin/rb_lexer/is.rb +1114 -0
- data/lib/gherkin/rb_lexer/it.rb +1075 -0
- data/lib/gherkin/rb_lexer/ja.rb +1412 -0
- data/lib/gherkin/rb_lexer/ko.rb +1096 -0
- data/lib/gherkin/rb_lexer/lt.rb +1038 -0
- data/lib/gherkin/rb_lexer/lu.rb +1126 -0
- data/lib/gherkin/rb_lexer/lv.rb +1158 -0
- data/lib/gherkin/rb_lexer/nl.rb +1109 -0
- data/lib/gherkin/rb_lexer/no.rb +1052 -0
- data/lib/gherkin/rb_lexer/pl.rb +1208 -0
- data/lib/gherkin/rb_lexer/pt.rb +1066 -0
- data/lib/gherkin/rb_lexer/ro.rb +1155 -0
- data/lib/gherkin/rb_lexer/ru.rb +1747 -0
- data/lib/gherkin/rb_lexer/sk.rb +1040 -0
- data/lib/gherkin/rb_lexer/sr_cyrl.rb +1797 -0
- data/lib/gherkin/rb_lexer/sr_latn.rb +1288 -0
- data/lib/gherkin/rb_lexer/sv.rb +1064 -0
- data/lib/gherkin/rb_lexer/tr.rb +1086 -0
- data/lib/gherkin/rb_lexer/uk.rb +1640 -0
- data/lib/gherkin/rb_lexer/uz.rb +1370 -0
- data/lib/gherkin/rb_lexer/vi.rb +1190 -0
- data/lib/gherkin/rb_lexer/zh_cn.rb +968 -0
- data/lib/gherkin/rb_lexer/zh_tw.rb +1006 -0
- data/spec/gherkin/fixtures/examples_with_only_header.feature +14 -0
- data/spec/gherkin/formatter/filter_formatter_spec.rb +21 -0
- data/tasks/gems.rake +9 -1
- metadata +30 -39
- data/.gitignore +0 -13
- data/ikvm/.gitignore +0 -3
- data/java/.gitignore +0 -5
- data/java/src/main/java/gherkin/lexer/i18n/.gitignore +0 -1
- data/java/src/main/resources/gherkin/.gitignore +0 -1
- data/js/.gitignore +0 -1
- data/js/lib/gherkin/lexer/.gitignore +0 -1
- data/lib/.gitignore +0 -4
- data/lib/gherkin/rb_lexer/.gitignore +0 -1
- data/ragel/i18n/.gitignore +0 -1
- data/tasks/bench/generated/.gitignore +0 -1
@@ -0,0 +1,1331 @@
|
|
1
|
+
|
2
|
+
#line 1 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
3
|
+
#include <assert.h>
|
4
|
+
#include <ruby.h>
|
5
|
+
|
6
|
+
#if defined(_WIN32)
|
7
|
+
#include <stddef.h>
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#ifdef HAVE_RUBY_RE_H
|
11
|
+
#include <ruby/re.h>
|
12
|
+
#else
|
13
|
+
#include <re.h>
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
17
|
+
#include <ruby/encoding.h>
|
18
|
+
#define ENCODED_STR_NEW(ptr, len) \
|
19
|
+
rb_enc_str_new(ptr, len, rb_utf8_encoding())
|
20
|
+
#else
|
21
|
+
#define ENCODED_STR_NEW(ptr, len) \
|
22
|
+
rb_str_new(ptr, len)
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#ifndef RSTRING_PTR
|
26
|
+
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#ifndef RSTRING_LEN
|
30
|
+
#define RSTRING_LEN(s) (RSTRING(s)->len)
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#define DATA_GET(FROM, TYPE, NAME) \
|
34
|
+
Data_Get_Struct(FROM, TYPE, NAME); \
|
35
|
+
if (NAME == NULL) { \
|
36
|
+
rb_raise(rb_eArgError, "NULL found for " # NAME " when it shouldn't be."); \
|
37
|
+
}
|
38
|
+
|
39
|
+
typedef struct lexer_state {
|
40
|
+
int content_len;
|
41
|
+
int line_number;
|
42
|
+
int current_line;
|
43
|
+
int start_col;
|
44
|
+
size_t mark;
|
45
|
+
size_t keyword_start;
|
46
|
+
size_t keyword_end;
|
47
|
+
size_t next_keyword_start;
|
48
|
+
size_t content_start;
|
49
|
+
size_t content_end;
|
50
|
+
size_t docstring_content_type_start;
|
51
|
+
size_t docstring_content_type_end;
|
52
|
+
size_t query_start;
|
53
|
+
size_t last_newline;
|
54
|
+
size_t final_newline;
|
55
|
+
} lexer_state;
|
56
|
+
|
57
|
+
static VALUE mGherkin;
|
58
|
+
static VALUE mGherkinLexer;
|
59
|
+
static VALUE mCLexer;
|
60
|
+
static VALUE cI18nLexer;
|
61
|
+
static VALUE rb_eGherkinLexingError;
|
62
|
+
|
63
|
+
#define LEN(AT, P) (P - data - lexer->AT)
|
64
|
+
#define MARK(M, P) (lexer->M = (P) - data)
|
65
|
+
#define PTR_TO(P) (data + lexer->P)
|
66
|
+
|
67
|
+
#define STORE_KW_END_CON(EVENT) \
|
68
|
+
store_multiline_kw_con(listener, # EVENT, \
|
69
|
+
PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end - 1)), \
|
70
|
+
PTR_TO(content_start), LEN(content_start, PTR_TO(content_end)), \
|
71
|
+
lexer->current_line, lexer->start_col); \
|
72
|
+
if (lexer->content_end != 0) { \
|
73
|
+
p = PTR_TO(content_end - 1); \
|
74
|
+
} \
|
75
|
+
lexer->content_end = 0
|
76
|
+
|
77
|
+
#define STORE_ATTR(ATTR) \
|
78
|
+
store_attr(listener, # ATTR, \
|
79
|
+
PTR_TO(content_start), LEN(content_start, p), \
|
80
|
+
lexer->line_number)
|
81
|
+
|
82
|
+
|
83
|
+
#line 254 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
84
|
+
|
85
|
+
|
86
|
+
/** Data **/
|
87
|
+
|
88
|
+
#line 89 "ext/gherkin_lexer_it/gherkin_lexer_it.c"
|
89
|
+
static const char _lexer_actions[] = {
|
90
|
+
0, 1, 0, 1, 1, 1, 2, 1,
|
91
|
+
3, 1, 4, 1, 5, 1, 6, 1,
|
92
|
+
7, 1, 8, 1, 9, 1, 10, 1,
|
93
|
+
11, 1, 12, 1, 13, 1, 16, 1,
|
94
|
+
17, 1, 18, 1, 19, 1, 20, 1,
|
95
|
+
21, 1, 22, 1, 23, 2, 1, 18,
|
96
|
+
2, 4, 5, 2, 13, 0, 2, 14,
|
97
|
+
15, 2, 17, 0, 2, 17, 2, 2,
|
98
|
+
17, 16, 2, 17, 19, 2, 18, 6,
|
99
|
+
2, 18, 7, 2, 18, 8, 2, 18,
|
100
|
+
9, 2, 18, 10, 2, 18, 16, 2,
|
101
|
+
20, 21, 2, 22, 0, 2, 22, 2,
|
102
|
+
2, 22, 16, 2, 22, 19, 3, 3,
|
103
|
+
14, 15, 3, 5, 14, 15, 3, 11,
|
104
|
+
14, 15, 3, 12, 14, 15, 3, 13,
|
105
|
+
14, 15, 3, 14, 15, 18, 3, 17,
|
106
|
+
14, 15, 4, 1, 14, 15, 18, 4,
|
107
|
+
4, 5, 14, 15, 4, 17, 0, 14,
|
108
|
+
15
|
109
|
+
};
|
110
|
+
|
111
|
+
static const short _lexer_key_offsets[] = {
|
112
|
+
0, 0, 19, 20, 21, 39, 40, 41,
|
113
|
+
43, 45, 50, 55, 60, 65, 69, 73,
|
114
|
+
75, 76, 77, 78, 79, 80, 81, 82,
|
115
|
+
83, 84, 85, 86, 87, 88, 89, 90,
|
116
|
+
91, 92, 94, 99, 106, 111, 112, 113,
|
117
|
+
114, 115, 116, 117, 118, 119, 120, 121,
|
118
|
+
122, 123, 124, 125, 126, 141, 143, 145,
|
119
|
+
147, 149, 151, 153, 155, 157, 159, 161,
|
120
|
+
163, 165, 167, 169, 171, 189, 190, 191,
|
121
|
+
192, 194, 195, 196, 197, 198, 199, 200,
|
122
|
+
201, 208, 210, 212, 214, 216, 218, 220,
|
123
|
+
222, 224, 226, 228, 230, 232, 234, 235,
|
124
|
+
236, 237, 238, 239, 240, 241, 242, 243,
|
125
|
+
244, 245, 246, 247, 248, 249, 260, 262,
|
126
|
+
264, 266, 268, 270, 272, 274, 276, 278,
|
127
|
+
280, 282, 284, 286, 288, 290, 292, 294,
|
128
|
+
296, 298, 300, 302, 304, 306, 308, 310,
|
129
|
+
312, 314, 316, 318, 320, 322, 324, 326,
|
130
|
+
328, 330, 332, 334, 336, 338, 340, 343,
|
131
|
+
345, 347, 349, 351, 353, 355, 357, 359,
|
132
|
+
361, 363, 365, 367, 369, 371, 373, 375,
|
133
|
+
377, 378, 379, 380, 381, 382, 384, 385,
|
134
|
+
386, 387, 388, 389, 390, 391, 392, 408,
|
135
|
+
410, 412, 414, 416, 418, 420, 422, 424,
|
136
|
+
426, 428, 430, 432, 434, 436, 438, 440,
|
137
|
+
442, 444, 446, 448, 450, 452, 454, 456,
|
138
|
+
458, 460, 462, 464, 466, 468, 470, 472,
|
139
|
+
474, 476, 478, 480, 482, 484, 486, 488,
|
140
|
+
490, 492, 494, 496, 498, 500, 502, 504,
|
141
|
+
507, 509, 511, 513, 515, 517, 519, 521,
|
142
|
+
523, 525, 527, 529, 531, 533, 535, 537,
|
143
|
+
539, 541, 542, 543, 544, 545, 546, 547,
|
144
|
+
548, 549, 550, 551, 552, 553, 554, 555,
|
145
|
+
556, 557, 558, 559, 560, 561, 562, 577,
|
146
|
+
579, 581, 583, 585, 587, 589, 591, 593,
|
147
|
+
595, 597, 599, 601, 603, 605, 607, 609,
|
148
|
+
611, 613, 615, 617, 619, 621, 623, 625,
|
149
|
+
627, 629, 631, 633, 635, 637, 639, 641,
|
150
|
+
643, 645, 647, 649, 651, 653, 655, 657,
|
151
|
+
659, 661, 663, 665, 667, 669, 671, 675,
|
152
|
+
681, 684, 686, 692, 710, 712, 714, 716,
|
153
|
+
718, 720, 722, 724, 726, 728, 730, 732,
|
154
|
+
734, 736, 738, 740, 742, 744, 746, 748,
|
155
|
+
750, 752, 754, 756, 758, 760, 762, 765,
|
156
|
+
767, 769, 771, 773, 775, 777, 779, 781,
|
157
|
+
783, 785, 787, 789, 791, 793, 795, 797,
|
158
|
+
799, 801
|
159
|
+
};
|
160
|
+
|
161
|
+
static const char _lexer_trans_keys[] = {
|
162
|
+
-17, 10, 32, 34, 35, 37, 42, 64,
|
163
|
+
65, 67, 68, 69, 70, 77, 81, 83,
|
164
|
+
124, 9, 13, -69, -65, 10, 32, 34,
|
165
|
+
35, 37, 42, 64, 65, 67, 68, 69,
|
166
|
+
70, 77, 81, 83, 124, 9, 13, 34,
|
167
|
+
34, 10, 13, 10, 13, 10, 32, 34,
|
168
|
+
9, 13, 10, 32, 34, 9, 13, 10,
|
169
|
+
32, 34, 9, 13, 10, 32, 34, 9,
|
170
|
+
13, 10, 32, 9, 13, 10, 32, 9,
|
171
|
+
13, 10, 13, 10, 95, 70, 69, 65,
|
172
|
+
84, 85, 82, 69, 95, 69, 78, 68,
|
173
|
+
95, 37, 32, 10, 10, 13, 13, 32,
|
174
|
+
64, 9, 10, 9, 10, 13, 32, 64,
|
175
|
+
11, 12, 10, 32, 64, 9, 13, 108,
|
176
|
+
108, 111, 114, 97, 111, 110, 116, 101,
|
177
|
+
115, 116, 111, 58, 10, 10, 10, 32,
|
178
|
+
35, 37, 42, 64, 65, 68, 69, 70,
|
179
|
+
77, 81, 83, 9, 13, 10, 95, 10,
|
180
|
+
70, 10, 69, 10, 65, 10, 84, 10,
|
181
|
+
85, 10, 82, 10, 69, 10, 95, 10,
|
182
|
+
69, 10, 78, 10, 68, 10, 95, 10,
|
183
|
+
37, 10, 32, 10, 32, 34, 35, 37,
|
184
|
+
42, 64, 65, 67, 68, 69, 70, 77,
|
185
|
+
81, 83, 124, 9, 13, 97, 116, 111,
|
186
|
+
32, 115, 101, 109, 112, 105, 58, 10,
|
187
|
+
10, 10, 32, 35, 70, 124, 9, 13,
|
188
|
+
10, 117, 10, 110, 10, 122, 10, 105,
|
189
|
+
10, 111, 10, 110, 10, 97, 10, 108,
|
190
|
+
10, 105, 10, 116, -61, 10, -96, 10,
|
191
|
+
10, 58, 117, 110, 122, 105, 111, 110,
|
192
|
+
97, 108, 105, 116, -61, -96, 58, 10,
|
193
|
+
10, 10, 32, 35, 37, 64, 67, 69,
|
194
|
+
70, 83, 9, 13, 10, 95, 10, 70,
|
195
|
+
10, 69, 10, 65, 10, 84, 10, 85,
|
196
|
+
10, 82, 10, 69, 10, 95, 10, 69,
|
197
|
+
10, 78, 10, 68, 10, 95, 10, 37,
|
198
|
+
10, 111, 10, 110, 10, 116, 10, 101,
|
199
|
+
10, 115, 10, 116, 10, 111, 10, 58,
|
200
|
+
10, 115, 10, 101, 10, 109, 10, 112,
|
201
|
+
10, 105, 10, 117, 10, 110, 10, 122,
|
202
|
+
10, 105, 10, 111, 10, 110, 10, 97,
|
203
|
+
10, 108, 10, 105, 10, 116, -61, 10,
|
204
|
+
-96, 10, 10, 99, 10, 101, 104, 10,
|
205
|
+
110, 10, 97, 10, 114, 10, 105, 10,
|
206
|
+
101, 10, 109, 10, 97, 10, 32, 10,
|
207
|
+
100, 10, 101, 10, 108, 10, 108, 10,
|
208
|
+
111, 10, 32, 10, 115, 10, 99, 10,
|
209
|
+
101, 117, 97, 110, 100, 99, 101, 104,
|
210
|
+
110, 97, 114, 105, 111, 58, 10, 10,
|
211
|
+
10, 32, 35, 37, 42, 64, 65, 67,
|
212
|
+
68, 69, 70, 77, 81, 83, 9, 13,
|
213
|
+
10, 95, 10, 70, 10, 69, 10, 65,
|
214
|
+
10, 84, 10, 85, 10, 82, 10, 69,
|
215
|
+
10, 95, 10, 69, 10, 78, 10, 68,
|
216
|
+
10, 95, 10, 37, 10, 32, 10, 108,
|
217
|
+
10, 108, 10, 111, 10, 114, 10, 97,
|
218
|
+
10, 111, 10, 110, 10, 116, 10, 101,
|
219
|
+
10, 115, 10, 116, 10, 111, 10, 58,
|
220
|
+
10, 97, 10, 116, 10, 111, 10, 117,
|
221
|
+
10, 110, 10, 122, 10, 105, 10, 111,
|
222
|
+
10, 110, 10, 97, 10, 108, 10, 105,
|
223
|
+
10, 116, -61, 10, -96, 10, 10, 117,
|
224
|
+
10, 97, 10, 110, 10, 100, 10, 99,
|
225
|
+
10, 101, 104, 10, 110, 10, 97, 10,
|
226
|
+
114, 10, 105, 10, 101, 10, 109, 10,
|
227
|
+
97, 10, 32, 10, 100, 10, 101, 10,
|
228
|
+
108, 10, 108, 10, 111, 10, 32, 10,
|
229
|
+
115, 10, 99, 10, 101, 101, 109, 97,
|
230
|
+
32, 100, 101, 108, 108, 111, 32, 115,
|
231
|
+
99, 101, 110, 97, 114, 105, 111, 58,
|
232
|
+
10, 10, 10, 32, 35, 37, 42, 64,
|
233
|
+
65, 68, 69, 70, 77, 81, 83, 9,
|
234
|
+
13, 10, 95, 10, 70, 10, 69, 10,
|
235
|
+
65, 10, 84, 10, 85, 10, 82, 10,
|
236
|
+
69, 10, 95, 10, 69, 10, 78, 10,
|
237
|
+
68, 10, 95, 10, 37, 10, 32, 10,
|
238
|
+
108, 10, 108, 10, 111, 10, 114, 10,
|
239
|
+
97, 10, 97, 10, 116, 10, 111, 10,
|
240
|
+
117, 10, 110, 10, 122, 10, 105, 10,
|
241
|
+
111, 10, 110, 10, 97, 10, 108, 10,
|
242
|
+
105, 10, 116, -61, 10, -96, 10, 10,
|
243
|
+
58, 10, 117, 10, 97, 10, 110, 10,
|
244
|
+
100, 10, 99, 10, 101, 10, 110, 10,
|
245
|
+
97, 10, 114, 10, 105, 10, 111, 32,
|
246
|
+
124, 9, 13, 10, 32, 92, 124, 9,
|
247
|
+
13, 10, 92, 124, 10, 92, 10, 32,
|
248
|
+
92, 124, 9, 13, 10, 32, 34, 35,
|
249
|
+
37, 42, 64, 65, 67, 68, 69, 70,
|
250
|
+
77, 81, 83, 124, 9, 13, 10, 108,
|
251
|
+
10, 108, 10, 111, 10, 114, 10, 97,
|
252
|
+
10, 97, 10, 116, 10, 111, 10, 117,
|
253
|
+
10, 110, 10, 122, 10, 105, 10, 111,
|
254
|
+
10, 110, 10, 97, 10, 108, 10, 105,
|
255
|
+
10, 116, -61, 10, -96, 10, 10, 58,
|
256
|
+
10, 117, 10, 97, 10, 110, 10, 100,
|
257
|
+
10, 99, 10, 101, 104, 10, 110, 10,
|
258
|
+
97, 10, 114, 10, 105, 10, 111, 10,
|
259
|
+
101, 10, 109, 10, 97, 10, 32, 10,
|
260
|
+
100, 10, 101, 10, 108, 10, 108, 10,
|
261
|
+
111, 10, 32, 10, 115, 10, 99, 10,
|
262
|
+
101, 0
|
263
|
+
};
|
264
|
+
|
265
|
+
static const char _lexer_single_lengths[] = {
|
266
|
+
0, 17, 1, 1, 16, 1, 1, 2,
|
267
|
+
2, 3, 3, 3, 3, 2, 2, 2,
|
268
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
269
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
270
|
+
1, 2, 3, 5, 3, 1, 1, 1,
|
271
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
272
|
+
1, 1, 1, 1, 13, 2, 2, 2,
|
273
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
274
|
+
2, 2, 2, 2, 16, 1, 1, 1,
|
275
|
+
2, 1, 1, 1, 1, 1, 1, 1,
|
276
|
+
5, 2, 2, 2, 2, 2, 2, 2,
|
277
|
+
2, 2, 2, 2, 2, 2, 1, 1,
|
278
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
279
|
+
1, 1, 1, 1, 1, 9, 2, 2,
|
280
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
281
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
282
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
283
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
284
|
+
2, 2, 2, 2, 2, 2, 3, 2,
|
285
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
286
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
287
|
+
1, 1, 1, 1, 1, 2, 1, 1,
|
288
|
+
1, 1, 1, 1, 1, 1, 14, 2,
|
289
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
290
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
291
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
292
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
293
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
294
|
+
2, 2, 2, 2, 2, 2, 2, 3,
|
295
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
296
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
297
|
+
2, 1, 1, 1, 1, 1, 1, 1,
|
298
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
299
|
+
1, 1, 1, 1, 1, 1, 13, 2,
|
300
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
301
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
302
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
303
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
304
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
305
|
+
2, 2, 2, 2, 2, 2, 2, 4,
|
306
|
+
3, 2, 4, 16, 2, 2, 2, 2,
|
307
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
308
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
309
|
+
2, 2, 2, 2, 2, 2, 3, 2,
|
310
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
311
|
+
2, 2, 2, 2, 2, 2, 2, 2,
|
312
|
+
2, 0
|
313
|
+
};
|
314
|
+
|
315
|
+
static const char _lexer_range_lengths[] = {
|
316
|
+
0, 1, 0, 0, 1, 0, 0, 0,
|
317
|
+
0, 1, 1, 1, 1, 1, 1, 0,
|
318
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
319
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
320
|
+
0, 0, 1, 1, 1, 0, 0, 0,
|
321
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
322
|
+
0, 0, 0, 0, 1, 0, 0, 0,
|
323
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
324
|
+
0, 0, 0, 0, 1, 0, 0, 0,
|
325
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
326
|
+
1, 0, 0, 0, 0, 0, 0, 0,
|
327
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
328
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
329
|
+
0, 0, 0, 0, 0, 1, 0, 0,
|
330
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
331
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
332
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
333
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
334
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
335
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
336
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
337
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
338
|
+
0, 0, 0, 0, 0, 0, 1, 0,
|
339
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
340
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
341
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
342
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
343
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
344
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
345
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
346
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
347
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
348
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
349
|
+
0, 0, 0, 0, 0, 0, 1, 0,
|
350
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
351
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
352
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
353
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
354
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
355
|
+
0, 0, 0, 0, 0, 0, 1, 1,
|
356
|
+
0, 0, 1, 1, 0, 0, 0, 0,
|
357
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
358
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
359
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
360
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
361
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
362
|
+
0, 0
|
363
|
+
};
|
364
|
+
|
365
|
+
static const short _lexer_index_offsets[] = {
|
366
|
+
0, 0, 19, 21, 23, 41, 43, 45,
|
367
|
+
48, 51, 56, 61, 66, 71, 75, 79,
|
368
|
+
82, 84, 86, 88, 90, 92, 94, 96,
|
369
|
+
98, 100, 102, 104, 106, 108, 110, 112,
|
370
|
+
114, 116, 119, 124, 131, 136, 138, 140,
|
371
|
+
142, 144, 146, 148, 150, 152, 154, 156,
|
372
|
+
158, 160, 162, 164, 166, 181, 184, 187,
|
373
|
+
190, 193, 196, 199, 202, 205, 208, 211,
|
374
|
+
214, 217, 220, 223, 226, 244, 246, 248,
|
375
|
+
250, 253, 255, 257, 259, 261, 263, 265,
|
376
|
+
267, 274, 277, 280, 283, 286, 289, 292,
|
377
|
+
295, 298, 301, 304, 307, 310, 313, 315,
|
378
|
+
317, 319, 321, 323, 325, 327, 329, 331,
|
379
|
+
333, 335, 337, 339, 341, 343, 354, 357,
|
380
|
+
360, 363, 366, 369, 372, 375, 378, 381,
|
381
|
+
384, 387, 390, 393, 396, 399, 402, 405,
|
382
|
+
408, 411, 414, 417, 420, 423, 426, 429,
|
383
|
+
432, 435, 438, 441, 444, 447, 450, 453,
|
384
|
+
456, 459, 462, 465, 468, 471, 474, 478,
|
385
|
+
481, 484, 487, 490, 493, 496, 499, 502,
|
386
|
+
505, 508, 511, 514, 517, 520, 523, 526,
|
387
|
+
529, 531, 533, 535, 537, 539, 542, 544,
|
388
|
+
546, 548, 550, 552, 554, 556, 558, 574,
|
389
|
+
577, 580, 583, 586, 589, 592, 595, 598,
|
390
|
+
601, 604, 607, 610, 613, 616, 619, 622,
|
391
|
+
625, 628, 631, 634, 637, 640, 643, 646,
|
392
|
+
649, 652, 655, 658, 661, 664, 667, 670,
|
393
|
+
673, 676, 679, 682, 685, 688, 691, 694,
|
394
|
+
697, 700, 703, 706, 709, 712, 715, 718,
|
395
|
+
722, 725, 728, 731, 734, 737, 740, 743,
|
396
|
+
746, 749, 752, 755, 758, 761, 764, 767,
|
397
|
+
770, 773, 775, 777, 779, 781, 783, 785,
|
398
|
+
787, 789, 791, 793, 795, 797, 799, 801,
|
399
|
+
803, 805, 807, 809, 811, 813, 815, 830,
|
400
|
+
833, 836, 839, 842, 845, 848, 851, 854,
|
401
|
+
857, 860, 863, 866, 869, 872, 875, 878,
|
402
|
+
881, 884, 887, 890, 893, 896, 899, 902,
|
403
|
+
905, 908, 911, 914, 917, 920, 923, 926,
|
404
|
+
929, 932, 935, 938, 941, 944, 947, 950,
|
405
|
+
953, 956, 959, 962, 965, 968, 971, 975,
|
406
|
+
981, 985, 988, 994, 1012, 1015, 1018, 1021,
|
407
|
+
1024, 1027, 1030, 1033, 1036, 1039, 1042, 1045,
|
408
|
+
1048, 1051, 1054, 1057, 1060, 1063, 1066, 1069,
|
409
|
+
1072, 1075, 1078, 1081, 1084, 1087, 1090, 1094,
|
410
|
+
1097, 1100, 1103, 1106, 1109, 1112, 1115, 1118,
|
411
|
+
1121, 1124, 1127, 1130, 1133, 1136, 1139, 1142,
|
412
|
+
1145, 1148
|
413
|
+
};
|
414
|
+
|
415
|
+
static const short _lexer_trans_targs[] = {
|
416
|
+
2, 4, 4, 5, 15, 17, 31, 34,
|
417
|
+
37, 42, 69, 72, 94, 41, 168, 172,
|
418
|
+
318, 4, 0, 3, 0, 4, 0, 4,
|
419
|
+
4, 5, 15, 17, 31, 34, 37, 42,
|
420
|
+
69, 72, 94, 41, 168, 172, 318, 4,
|
421
|
+
0, 6, 0, 7, 0, 9, 8, 8,
|
422
|
+
9, 8, 8, 10, 10, 11, 10, 10,
|
423
|
+
10, 10, 11, 10, 10, 10, 10, 12,
|
424
|
+
10, 10, 10, 10, 13, 10, 10, 4,
|
425
|
+
14, 14, 0, 4, 14, 14, 0, 4,
|
426
|
+
16, 15, 4, 0, 18, 0, 19, 0,
|
427
|
+
20, 0, 21, 0, 22, 0, 23, 0,
|
428
|
+
24, 0, 25, 0, 26, 0, 27, 0,
|
429
|
+
28, 0, 29, 0, 30, 0, 369, 0,
|
430
|
+
32, 0, 0, 33, 4, 16, 33, 0,
|
431
|
+
0, 0, 0, 35, 36, 4, 36, 36,
|
432
|
+
34, 35, 35, 4, 36, 34, 36, 0,
|
433
|
+
38, 0, 39, 0, 40, 0, 41, 0,
|
434
|
+
31, 0, 43, 0, 44, 0, 45, 0,
|
435
|
+
46, 0, 47, 0, 48, 0, 49, 0,
|
436
|
+
50, 0, 52, 51, 52, 51, 52, 52,
|
437
|
+
4, 53, 67, 4, 324, 329, 67, 332,
|
438
|
+
328, 345, 349, 52, 51, 52, 54, 51,
|
439
|
+
52, 55, 51, 52, 56, 51, 52, 57,
|
440
|
+
51, 52, 58, 51, 52, 59, 51, 52,
|
441
|
+
60, 51, 52, 61, 51, 52, 62, 51,
|
442
|
+
52, 63, 51, 52, 64, 51, 52, 65,
|
443
|
+
51, 52, 66, 51, 52, 4, 51, 52,
|
444
|
+
68, 51, 4, 4, 5, 15, 17, 31,
|
445
|
+
34, 37, 42, 69, 72, 94, 41, 168,
|
446
|
+
172, 318, 4, 0, 70, 0, 71, 0,
|
447
|
+
31, 0, 32, 73, 0, 74, 0, 75,
|
448
|
+
0, 76, 0, 77, 0, 78, 0, 80,
|
449
|
+
79, 80, 79, 80, 80, 4, 81, 4,
|
450
|
+
80, 79, 80, 82, 79, 80, 83, 79,
|
451
|
+
80, 84, 79, 80, 85, 79, 80, 86,
|
452
|
+
79, 80, 87, 79, 80, 88, 79, 80,
|
453
|
+
89, 79, 80, 90, 79, 80, 91, 79,
|
454
|
+
92, 80, 79, 93, 80, 79, 80, 68,
|
455
|
+
79, 95, 0, 96, 0, 97, 0, 98,
|
456
|
+
0, 99, 0, 100, 0, 101, 0, 102,
|
457
|
+
0, 103, 0, 104, 0, 105, 0, 106,
|
458
|
+
0, 107, 0, 109, 108, 109, 108, 109,
|
459
|
+
109, 4, 110, 4, 124, 132, 137, 149,
|
460
|
+
109, 108, 109, 111, 108, 109, 112, 108,
|
461
|
+
109, 113, 108, 109, 114, 108, 109, 115,
|
462
|
+
108, 109, 116, 108, 109, 117, 108, 109,
|
463
|
+
118, 108, 109, 119, 108, 109, 120, 108,
|
464
|
+
109, 121, 108, 109, 122, 108, 109, 123,
|
465
|
+
108, 109, 4, 108, 109, 125, 108, 109,
|
466
|
+
126, 108, 109, 127, 108, 109, 128, 108,
|
467
|
+
109, 129, 108, 109, 130, 108, 109, 131,
|
468
|
+
108, 109, 68, 108, 109, 133, 108, 109,
|
469
|
+
134, 108, 109, 135, 108, 109, 136, 108,
|
470
|
+
109, 131, 108, 109, 138, 108, 109, 139,
|
471
|
+
108, 109, 140, 108, 109, 141, 108, 109,
|
472
|
+
142, 108, 109, 143, 108, 109, 144, 108,
|
473
|
+
109, 145, 108, 109, 146, 108, 109, 147,
|
474
|
+
108, 148, 109, 108, 131, 109, 108, 109,
|
475
|
+
150, 108, 109, 151, 155, 108, 109, 152,
|
476
|
+
108, 109, 153, 108, 109, 154, 108, 109,
|
477
|
+
130, 108, 109, 156, 108, 109, 157, 108,
|
478
|
+
109, 158, 108, 109, 159, 108, 109, 160,
|
479
|
+
108, 109, 161, 108, 109, 162, 108, 109,
|
480
|
+
163, 108, 109, 164, 108, 109, 165, 108,
|
481
|
+
109, 166, 108, 109, 167, 108, 109, 151,
|
482
|
+
108, 169, 0, 170, 0, 171, 0, 71,
|
483
|
+
0, 173, 0, 174, 249, 0, 175, 0,
|
484
|
+
176, 0, 177, 0, 178, 0, 179, 0,
|
485
|
+
180, 0, 182, 181, 182, 181, 182, 182,
|
486
|
+
4, 183, 197, 4, 198, 203, 211, 197,
|
487
|
+
214, 202, 226, 230, 182, 181, 182, 184,
|
488
|
+
181, 182, 185, 181, 182, 186, 181, 182,
|
489
|
+
187, 181, 182, 188, 181, 182, 189, 181,
|
490
|
+
182, 190, 181, 182, 191, 181, 182, 192,
|
491
|
+
181, 182, 193, 181, 182, 194, 181, 182,
|
492
|
+
195, 181, 182, 196, 181, 182, 4, 181,
|
493
|
+
182, 68, 181, 182, 199, 181, 182, 200,
|
494
|
+
181, 182, 201, 181, 182, 202, 181, 182,
|
495
|
+
197, 181, 182, 204, 181, 182, 205, 181,
|
496
|
+
182, 206, 181, 182, 207, 181, 182, 208,
|
497
|
+
181, 182, 209, 181, 182, 210, 181, 182,
|
498
|
+
68, 181, 182, 212, 181, 182, 213, 181,
|
499
|
+
182, 197, 181, 182, 215, 181, 182, 216,
|
500
|
+
181, 182, 217, 181, 182, 218, 181, 182,
|
501
|
+
219, 181, 182, 220, 181, 182, 221, 181,
|
502
|
+
182, 222, 181, 182, 223, 181, 182, 224,
|
503
|
+
181, 225, 182, 181, 210, 182, 181, 182,
|
504
|
+
227, 181, 182, 228, 181, 182, 229, 181,
|
505
|
+
182, 213, 181, 182, 231, 181, 182, 232,
|
506
|
+
236, 181, 182, 233, 181, 182, 234, 181,
|
507
|
+
182, 235, 181, 182, 209, 181, 182, 237,
|
508
|
+
181, 182, 238, 181, 182, 239, 181, 182,
|
509
|
+
240, 181, 182, 241, 181, 182, 242, 181,
|
510
|
+
182, 243, 181, 182, 244, 181, 182, 245,
|
511
|
+
181, 182, 246, 181, 182, 247, 181, 182,
|
512
|
+
248, 181, 182, 232, 181, 250, 0, 251,
|
513
|
+
0, 252, 0, 253, 0, 254, 0, 255,
|
514
|
+
0, 256, 0, 257, 0, 258, 0, 259,
|
515
|
+
0, 260, 0, 261, 0, 262, 0, 263,
|
516
|
+
0, 264, 0, 265, 0, 266, 0, 267,
|
517
|
+
0, 268, 0, 270, 269, 270, 269, 270,
|
518
|
+
270, 4, 271, 285, 4, 286, 291, 285,
|
519
|
+
294, 290, 307, 311, 270, 269, 270, 272,
|
520
|
+
269, 270, 273, 269, 270, 274, 269, 270,
|
521
|
+
275, 269, 270, 276, 269, 270, 277, 269,
|
522
|
+
270, 278, 269, 270, 279, 269, 270, 280,
|
523
|
+
269, 270, 281, 269, 270, 282, 269, 270,
|
524
|
+
283, 269, 270, 284, 269, 270, 4, 269,
|
525
|
+
270, 68, 269, 270, 287, 269, 270, 288,
|
526
|
+
269, 270, 289, 269, 270, 290, 269, 270,
|
527
|
+
285, 269, 270, 292, 269, 270, 293, 269,
|
528
|
+
270, 285, 269, 270, 295, 269, 270, 296,
|
529
|
+
269, 270, 297, 269, 270, 298, 269, 270,
|
530
|
+
299, 269, 270, 300, 269, 270, 301, 269,
|
531
|
+
270, 302, 269, 270, 303, 269, 270, 304,
|
532
|
+
269, 305, 270, 269, 306, 270, 269, 270,
|
533
|
+
68, 269, 270, 308, 269, 270, 309, 269,
|
534
|
+
270, 310, 269, 270, 293, 269, 270, 312,
|
535
|
+
269, 270, 313, 269, 270, 314, 269, 270,
|
536
|
+
315, 269, 270, 316, 269, 270, 317, 269,
|
537
|
+
270, 306, 269, 318, 319, 318, 0, 323,
|
538
|
+
322, 321, 319, 322, 320, 0, 321, 319,
|
539
|
+
320, 0, 321, 320, 323, 322, 321, 319,
|
540
|
+
322, 320, 323, 323, 5, 15, 17, 31,
|
541
|
+
34, 37, 42, 69, 72, 94, 41, 168,
|
542
|
+
172, 318, 323, 0, 52, 325, 51, 52,
|
543
|
+
326, 51, 52, 327, 51, 52, 328, 51,
|
544
|
+
52, 67, 51, 52, 330, 51, 52, 331,
|
545
|
+
51, 52, 67, 51, 52, 333, 51, 52,
|
546
|
+
334, 51, 52, 335, 51, 52, 336, 51,
|
547
|
+
52, 337, 51, 52, 338, 51, 52, 339,
|
548
|
+
51, 52, 340, 51, 52, 341, 51, 52,
|
549
|
+
342, 51, 343, 52, 51, 344, 52, 51,
|
550
|
+
52, 68, 51, 52, 346, 51, 52, 347,
|
551
|
+
51, 52, 348, 51, 52, 331, 51, 52,
|
552
|
+
350, 51, 52, 351, 356, 51, 52, 352,
|
553
|
+
51, 52, 353, 51, 52, 354, 51, 52,
|
554
|
+
355, 51, 52, 344, 51, 52, 357, 51,
|
555
|
+
52, 358, 51, 52, 359, 51, 52, 360,
|
556
|
+
51, 52, 361, 51, 52, 362, 51, 52,
|
557
|
+
363, 51, 52, 364, 51, 52, 365, 51,
|
558
|
+
52, 366, 51, 52, 367, 51, 52, 368,
|
559
|
+
51, 52, 351, 51, 0, 0
|
560
|
+
};
|
561
|
+
|
562
|
+
static const unsigned char _lexer_trans_actions[] = {
|
563
|
+
0, 54, 0, 5, 1, 0, 29, 1,
|
564
|
+
29, 29, 29, 29, 29, 29, 29, 29,
|
565
|
+
35, 0, 43, 0, 43, 0, 43, 54,
|
566
|
+
0, 5, 1, 0, 29, 1, 29, 29,
|
567
|
+
29, 29, 29, 29, 29, 29, 35, 0,
|
568
|
+
43, 0, 43, 0, 43, 135, 48, 9,
|
569
|
+
106, 11, 0, 130, 45, 45, 45, 3,
|
570
|
+
122, 33, 33, 33, 0, 122, 33, 33,
|
571
|
+
33, 0, 122, 33, 0, 33, 0, 102,
|
572
|
+
7, 7, 43, 54, 0, 0, 43, 114,
|
573
|
+
25, 0, 54, 43, 0, 43, 0, 43,
|
574
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
575
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
576
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
577
|
+
0, 43, 43, 57, 110, 23, 0, 43,
|
578
|
+
43, 43, 43, 0, 27, 118, 27, 27,
|
579
|
+
51, 27, 0, 54, 0, 1, 0, 43,
|
580
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
581
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
582
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
583
|
+
0, 43, 140, 57, 54, 0, 54, 0,
|
584
|
+
72, 33, 84, 72, 84, 84, 84, 84,
|
585
|
+
84, 84, 84, 0, 0, 54, 0, 0,
|
586
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
587
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
588
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
589
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
590
|
+
0, 54, 0, 0, 54, 15, 0, 54,
|
591
|
+
15, 0, 126, 31, 60, 57, 31, 63,
|
592
|
+
57, 63, 63, 63, 63, 63, 63, 63,
|
593
|
+
63, 66, 31, 43, 0, 43, 0, 43,
|
594
|
+
0, 43, 0, 0, 43, 0, 43, 0,
|
595
|
+
43, 0, 43, 0, 43, 0, 43, 140,
|
596
|
+
57, 54, 0, 54, 0, 81, 84, 81,
|
597
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
598
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
599
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
600
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
601
|
+
0, 54, 0, 0, 54, 0, 54, 21,
|
602
|
+
0, 0, 43, 0, 43, 0, 43, 0,
|
603
|
+
43, 0, 43, 0, 43, 0, 43, 0,
|
604
|
+
43, 0, 43, 0, 43, 0, 43, 0,
|
605
|
+
43, 0, 43, 140, 57, 54, 0, 54,
|
606
|
+
0, 69, 33, 69, 84, 84, 84, 84,
|
607
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
608
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
609
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
610
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
611
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
612
|
+
0, 54, 13, 0, 54, 0, 0, 54,
|
613
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
614
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
615
|
+
0, 54, 13, 0, 54, 0, 0, 54,
|
616
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
617
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
618
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
619
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
620
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
621
|
+
0, 0, 54, 0, 0, 54, 0, 54,
|
622
|
+
0, 0, 54, 0, 0, 0, 54, 0,
|
623
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
624
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
625
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
626
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
627
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
628
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
629
|
+
0, 0, 43, 0, 43, 0, 43, 0,
|
630
|
+
43, 0, 43, 0, 0, 43, 0, 43,
|
631
|
+
0, 43, 0, 43, 0, 43, 0, 43,
|
632
|
+
0, 43, 140, 57, 54, 0, 54, 0,
|
633
|
+
75, 33, 84, 75, 84, 84, 84, 84,
|
634
|
+
84, 84, 84, 84, 0, 0, 54, 0,
|
635
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
636
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
637
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
638
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
639
|
+
0, 0, 54, 0, 0, 54, 17, 0,
|
640
|
+
54, 17, 0, 54, 0, 0, 54, 0,
|
641
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
642
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
643
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
644
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
645
|
+
17, 0, 54, 0, 0, 54, 0, 0,
|
646
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
647
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
648
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
649
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
650
|
+
0, 0, 54, 0, 0, 54, 0, 54,
|
651
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
652
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
653
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
654
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
655
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
656
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
657
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
658
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
659
|
+
0, 0, 54, 0, 0, 0, 43, 0,
|
660
|
+
43, 0, 43, 0, 43, 0, 43, 0,
|
661
|
+
43, 0, 43, 0, 43, 0, 43, 0,
|
662
|
+
43, 0, 43, 0, 43, 0, 43, 0,
|
663
|
+
43, 0, 43, 0, 43, 0, 43, 0,
|
664
|
+
43, 0, 43, 140, 57, 54, 0, 54,
|
665
|
+
0, 78, 33, 84, 78, 84, 84, 84,
|
666
|
+
84, 84, 84, 84, 0, 0, 54, 0,
|
667
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
668
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
669
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
670
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
671
|
+
0, 0, 54, 0, 0, 54, 19, 0,
|
672
|
+
54, 19, 0, 54, 0, 0, 54, 0,
|
673
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
674
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
675
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
676
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
677
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
678
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
679
|
+
0, 0, 54, 0, 0, 54, 0, 54,
|
680
|
+
19, 0, 54, 0, 0, 54, 0, 0,
|
681
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
682
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
683
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
684
|
+
54, 0, 0, 0, 0, 0, 43, 54,
|
685
|
+
37, 37, 87, 37, 37, 43, 0, 39,
|
686
|
+
0, 43, 0, 0, 54, 0, 0, 39,
|
687
|
+
0, 0, 54, 0, 93, 90, 41, 96,
|
688
|
+
90, 96, 96, 96, 96, 96, 96, 96,
|
689
|
+
96, 99, 0, 43, 54, 0, 0, 54,
|
690
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
691
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
692
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
693
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
694
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
695
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
696
|
+
0, 0, 0, 54, 0, 0, 54, 0,
|
697
|
+
54, 15, 0, 54, 0, 0, 54, 0,
|
698
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
699
|
+
0, 0, 54, 0, 0, 0, 54, 0,
|
700
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
701
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
702
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
703
|
+
0, 54, 0, 0, 54, 0, 0, 54,
|
704
|
+
0, 0, 54, 0, 0, 54, 0, 0,
|
705
|
+
54, 0, 0, 54, 0, 0, 54, 0,
|
706
|
+
0, 54, 0, 0, 0, 0
|
707
|
+
};
|
708
|
+
|
709
|
+
static const unsigned char _lexer_eof_actions[] = {
|
710
|
+
0, 43, 43, 43, 43, 43, 43, 43,
|
711
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
712
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
713
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
714
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
715
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
716
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
717
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
718
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
719
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
720
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
721
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
722
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
723
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
724
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
725
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
726
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
727
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
728
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
729
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
730
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
731
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
732
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
733
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
734
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
735
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
736
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
737
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
738
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
739
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
740
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
741
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
742
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
743
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
744
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
745
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
746
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
747
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
748
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
749
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
750
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
751
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
752
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
753
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
754
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
755
|
+
43, 43, 43, 43, 43, 43, 43, 43,
|
756
|
+
43, 43
|
757
|
+
};
|
758
|
+
|
759
|
+
static const int lexer_start = 1;
|
760
|
+
static const int lexer_first_final = 369;
|
761
|
+
static const int lexer_error = 0;
|
762
|
+
|
763
|
+
static const int lexer_en_main = 1;
|
764
|
+
|
765
|
+
|
766
|
+
#line 258 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
767
|
+
|
768
|
+
static VALUE
|
769
|
+
unindent(VALUE con, int start_col)
|
770
|
+
{
|
771
|
+
VALUE re;
|
772
|
+
// Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters
|
773
|
+
char pat[32];
|
774
|
+
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
775
|
+
re = rb_reg_regcomp(rb_str_new2(pat));
|
776
|
+
rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2(""));
|
777
|
+
|
778
|
+
return Qnil;
|
779
|
+
|
780
|
+
}
|
781
|
+
|
782
|
+
static void
|
783
|
+
store_kw_con(VALUE listener, const char * event_name,
|
784
|
+
const char * keyword_at, size_t keyword_length,
|
785
|
+
const char * at, size_t length,
|
786
|
+
int current_line)
|
787
|
+
{
|
788
|
+
VALUE con = Qnil, kw = Qnil;
|
789
|
+
kw = ENCODED_STR_NEW(keyword_at, keyword_length);
|
790
|
+
con = ENCODED_STR_NEW(at, length);
|
791
|
+
rb_funcall(con, rb_intern("strip!"), 0);
|
792
|
+
rb_funcall(listener, rb_intern(event_name), 3, kw, con, INT2FIX(current_line));
|
793
|
+
}
|
794
|
+
|
795
|
+
static void
|
796
|
+
store_multiline_kw_con(VALUE listener, const char * event_name,
|
797
|
+
const char * keyword_at, size_t keyword_length,
|
798
|
+
const char * at, size_t length,
|
799
|
+
int current_line, int start_col)
|
800
|
+
{
|
801
|
+
VALUE split;
|
802
|
+
VALUE con = Qnil, kw = Qnil, name = Qnil, desc = Qnil;
|
803
|
+
|
804
|
+
kw = ENCODED_STR_NEW(keyword_at, keyword_length);
|
805
|
+
con = ENCODED_STR_NEW(at, length);
|
806
|
+
|
807
|
+
unindent(con, start_col);
|
808
|
+
|
809
|
+
split = rb_str_split(con, "\n");
|
810
|
+
|
811
|
+
name = rb_funcall(split, rb_intern("shift"), 0);
|
812
|
+
desc = rb_ary_join(split, rb_str_new2( "\n" ));
|
813
|
+
|
814
|
+
if( name == Qnil )
|
815
|
+
{
|
816
|
+
name = rb_str_new2("");
|
817
|
+
}
|
818
|
+
if( rb_funcall(desc, rb_intern("size"), 0) == 0)
|
819
|
+
{
|
820
|
+
desc = rb_str_new2("");
|
821
|
+
}
|
822
|
+
rb_funcall(name, rb_intern("strip!"), 0);
|
823
|
+
rb_funcall(desc, rb_intern("rstrip!"), 0);
|
824
|
+
rb_funcall(listener, rb_intern(event_name), 4, kw, name, desc, INT2FIX(current_line));
|
825
|
+
}
|
826
|
+
|
827
|
+
static void
|
828
|
+
store_attr(VALUE listener, const char * attr_type,
|
829
|
+
const char * at, size_t length,
|
830
|
+
int line)
|
831
|
+
{
|
832
|
+
VALUE val = ENCODED_STR_NEW(at, length);
|
833
|
+
rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line));
|
834
|
+
}
|
835
|
+
static void
|
836
|
+
store_docstring_content(VALUE listener,
|
837
|
+
int start_col,
|
838
|
+
const char *type_at, size_t type_length,
|
839
|
+
const char *at, size_t length,
|
840
|
+
int current_line)
|
841
|
+
{
|
842
|
+
VALUE re2;
|
843
|
+
VALUE unescape_escaped_quotes;
|
844
|
+
VALUE con = ENCODED_STR_NEW(at, length);
|
845
|
+
VALUE con_type = ENCODED_STR_NEW(type_at, type_length);
|
846
|
+
|
847
|
+
unindent(con, start_col);
|
848
|
+
|
849
|
+
re2 = rb_reg_regcomp(rb_str_new2("\r\\Z"));
|
850
|
+
unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\""));
|
851
|
+
rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
|
852
|
+
rb_funcall(con_type, rb_intern("strip!"), 0);
|
853
|
+
rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\""));
|
854
|
+
rb_funcall(listener, rb_intern("doc_string"), 3, con_type, con, INT2FIX(current_line));
|
855
|
+
}
|
856
|
+
static void
|
857
|
+
raise_lexer_error(const char * at, int line)
|
858
|
+
{
|
859
|
+
rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.", line, at);
|
860
|
+
}
|
861
|
+
|
862
|
+
static void lexer_init(lexer_state *lexer) {
|
863
|
+
lexer->content_start = 0;
|
864
|
+
lexer->content_end = 0;
|
865
|
+
lexer->content_len = 0;
|
866
|
+
lexer->docstring_content_type_start = 0;
|
867
|
+
lexer->docstring_content_type_end = 0;
|
868
|
+
lexer->mark = 0;
|
869
|
+
lexer->keyword_start = 0;
|
870
|
+
lexer->keyword_end = 0;
|
871
|
+
lexer->next_keyword_start = 0;
|
872
|
+
lexer->line_number = 1;
|
873
|
+
lexer->last_newline = 0;
|
874
|
+
lexer->final_newline = 0;
|
875
|
+
lexer->start_col = 0;
|
876
|
+
}
|
877
|
+
|
878
|
+
static VALUE CLexer_alloc(VALUE klass)
|
879
|
+
{
|
880
|
+
VALUE obj;
|
881
|
+
lexer_state *lxr = ALLOC(lexer_state);
|
882
|
+
lexer_init(lxr);
|
883
|
+
|
884
|
+
obj = Data_Wrap_Struct(klass, NULL, -1, lxr);
|
885
|
+
|
886
|
+
return obj;
|
887
|
+
}
|
888
|
+
|
889
|
+
static VALUE CLexer_init(VALUE self, VALUE listener)
|
890
|
+
{
|
891
|
+
lexer_state *lxr;
|
892
|
+
rb_iv_set(self, "@listener", listener);
|
893
|
+
|
894
|
+
lxr = NULL;
|
895
|
+
DATA_GET(self, lexer_state, lxr);
|
896
|
+
lexer_init(lxr);
|
897
|
+
|
898
|
+
return self;
|
899
|
+
}
|
900
|
+
|
901
|
+
static VALUE CLexer_scan(VALUE self, VALUE input)
|
902
|
+
{
|
903
|
+
VALUE input_copy;
|
904
|
+
char *data;
|
905
|
+
size_t len;
|
906
|
+
VALUE listener = rb_iv_get(self, "@listener");
|
907
|
+
|
908
|
+
lexer_state *lexer;
|
909
|
+
lexer = NULL;
|
910
|
+
DATA_GET(self, lexer_state, lexer);
|
911
|
+
|
912
|
+
input_copy = rb_str_dup(input);
|
913
|
+
|
914
|
+
rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%"));
|
915
|
+
data = RSTRING_PTR(input_copy);
|
916
|
+
len = RSTRING_LEN(input_copy);
|
917
|
+
|
918
|
+
if (len == 0) {
|
919
|
+
rb_raise(rb_eGherkinLexingError, "No content to lex.");
|
920
|
+
} else {
|
921
|
+
|
922
|
+
const char *p, *pe, *eof;
|
923
|
+
int cs = 0;
|
924
|
+
|
925
|
+
VALUE current_row = Qnil;
|
926
|
+
|
927
|
+
p = data;
|
928
|
+
pe = data + len;
|
929
|
+
eof = pe;
|
930
|
+
|
931
|
+
assert(*pe == '\0' && "pointer does not end on NULL");
|
932
|
+
|
933
|
+
|
934
|
+
#line 935 "ext/gherkin_lexer_it/gherkin_lexer_it.c"
|
935
|
+
{
|
936
|
+
cs = lexer_start;
|
937
|
+
}
|
938
|
+
|
939
|
+
#line 425 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
940
|
+
|
941
|
+
#line 942 "ext/gherkin_lexer_it/gherkin_lexer_it.c"
|
942
|
+
{
|
943
|
+
int _klen;
|
944
|
+
unsigned int _trans;
|
945
|
+
const char *_acts;
|
946
|
+
unsigned int _nacts;
|
947
|
+
const char *_keys;
|
948
|
+
|
949
|
+
if ( p == pe )
|
950
|
+
goto _test_eof;
|
951
|
+
if ( cs == 0 )
|
952
|
+
goto _out;
|
953
|
+
_resume:
|
954
|
+
_keys = _lexer_trans_keys + _lexer_key_offsets[cs];
|
955
|
+
_trans = _lexer_index_offsets[cs];
|
956
|
+
|
957
|
+
_klen = _lexer_single_lengths[cs];
|
958
|
+
if ( _klen > 0 ) {
|
959
|
+
const char *_lower = _keys;
|
960
|
+
const char *_mid;
|
961
|
+
const char *_upper = _keys + _klen - 1;
|
962
|
+
while (1) {
|
963
|
+
if ( _upper < _lower )
|
964
|
+
break;
|
965
|
+
|
966
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
967
|
+
if ( (*p) < *_mid )
|
968
|
+
_upper = _mid - 1;
|
969
|
+
else if ( (*p) > *_mid )
|
970
|
+
_lower = _mid + 1;
|
971
|
+
else {
|
972
|
+
_trans += (_mid - _keys);
|
973
|
+
goto _match;
|
974
|
+
}
|
975
|
+
}
|
976
|
+
_keys += _klen;
|
977
|
+
_trans += _klen;
|
978
|
+
}
|
979
|
+
|
980
|
+
_klen = _lexer_range_lengths[cs];
|
981
|
+
if ( _klen > 0 ) {
|
982
|
+
const char *_lower = _keys;
|
983
|
+
const char *_mid;
|
984
|
+
const char *_upper = _keys + (_klen<<1) - 2;
|
985
|
+
while (1) {
|
986
|
+
if ( _upper < _lower )
|
987
|
+
break;
|
988
|
+
|
989
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
990
|
+
if ( (*p) < _mid[0] )
|
991
|
+
_upper = _mid - 2;
|
992
|
+
else if ( (*p) > _mid[1] )
|
993
|
+
_lower = _mid + 2;
|
994
|
+
else {
|
995
|
+
_trans += ((_mid - _keys)>>1);
|
996
|
+
goto _match;
|
997
|
+
}
|
998
|
+
}
|
999
|
+
_trans += _klen;
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
_match:
|
1003
|
+
cs = _lexer_trans_targs[_trans];
|
1004
|
+
|
1005
|
+
if ( _lexer_trans_actions[_trans] == 0 )
|
1006
|
+
goto _again;
|
1007
|
+
|
1008
|
+
_acts = _lexer_actions + _lexer_trans_actions[_trans];
|
1009
|
+
_nacts = (unsigned int) *_acts++;
|
1010
|
+
while ( _nacts-- > 0 )
|
1011
|
+
{
|
1012
|
+
switch ( *_acts++ )
|
1013
|
+
{
|
1014
|
+
case 0:
|
1015
|
+
#line 83 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1016
|
+
{
|
1017
|
+
MARK(content_start, p);
|
1018
|
+
lexer->current_line = lexer->line_number;
|
1019
|
+
lexer->start_col = lexer->content_start - lexer->last_newline - (lexer->keyword_end - lexer->keyword_start) + 2;
|
1020
|
+
}
|
1021
|
+
break;
|
1022
|
+
case 1:
|
1023
|
+
#line 89 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1024
|
+
{
|
1025
|
+
MARK(content_start, p);
|
1026
|
+
}
|
1027
|
+
break;
|
1028
|
+
case 2:
|
1029
|
+
#line 93 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1030
|
+
{
|
1031
|
+
lexer->current_line = lexer->line_number;
|
1032
|
+
lexer->start_col = p - data - lexer->last_newline;
|
1033
|
+
}
|
1034
|
+
break;
|
1035
|
+
case 3:
|
1036
|
+
#line 98 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1037
|
+
{
|
1038
|
+
int len = LEN(content_start, PTR_TO(final_newline));
|
1039
|
+
int type_len = LEN(docstring_content_type_start, PTR_TO(docstring_content_type_end));
|
1040
|
+
|
1041
|
+
if (len < 0) len = 0;
|
1042
|
+
if (type_len < 0) len = 0;
|
1043
|
+
|
1044
|
+
store_docstring_content(listener, lexer->start_col, PTR_TO(docstring_content_type_start), type_len, PTR_TO(content_start), len, lexer->current_line);
|
1045
|
+
}
|
1046
|
+
break;
|
1047
|
+
case 4:
|
1048
|
+
#line 108 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1049
|
+
{
|
1050
|
+
MARK(docstring_content_type_start, p);
|
1051
|
+
}
|
1052
|
+
break;
|
1053
|
+
case 5:
|
1054
|
+
#line 112 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1055
|
+
{
|
1056
|
+
MARK(docstring_content_type_end, p);
|
1057
|
+
}
|
1058
|
+
break;
|
1059
|
+
case 6:
|
1060
|
+
#line 116 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1061
|
+
{
|
1062
|
+
STORE_KW_END_CON(feature);
|
1063
|
+
}
|
1064
|
+
break;
|
1065
|
+
case 7:
|
1066
|
+
#line 120 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1067
|
+
{
|
1068
|
+
STORE_KW_END_CON(background);
|
1069
|
+
}
|
1070
|
+
break;
|
1071
|
+
case 8:
|
1072
|
+
#line 124 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1073
|
+
{
|
1074
|
+
STORE_KW_END_CON(scenario);
|
1075
|
+
}
|
1076
|
+
break;
|
1077
|
+
case 9:
|
1078
|
+
#line 128 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1079
|
+
{
|
1080
|
+
STORE_KW_END_CON(scenario_outline);
|
1081
|
+
}
|
1082
|
+
break;
|
1083
|
+
case 10:
|
1084
|
+
#line 132 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1085
|
+
{
|
1086
|
+
STORE_KW_END_CON(examples);
|
1087
|
+
}
|
1088
|
+
break;
|
1089
|
+
case 11:
|
1090
|
+
#line 136 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1091
|
+
{
|
1092
|
+
store_kw_con(listener, "step",
|
1093
|
+
PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end)),
|
1094
|
+
PTR_TO(content_start), LEN(content_start, p),
|
1095
|
+
lexer->current_line);
|
1096
|
+
}
|
1097
|
+
break;
|
1098
|
+
case 12:
|
1099
|
+
#line 143 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1100
|
+
{
|
1101
|
+
STORE_ATTR(comment);
|
1102
|
+
lexer->mark = 0;
|
1103
|
+
}
|
1104
|
+
break;
|
1105
|
+
case 13:
|
1106
|
+
#line 148 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1107
|
+
{
|
1108
|
+
STORE_ATTR(tag);
|
1109
|
+
lexer->mark = 0;
|
1110
|
+
}
|
1111
|
+
break;
|
1112
|
+
case 14:
|
1113
|
+
#line 153 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1114
|
+
{
|
1115
|
+
lexer->line_number += 1;
|
1116
|
+
MARK(final_newline, p);
|
1117
|
+
}
|
1118
|
+
break;
|
1119
|
+
case 15:
|
1120
|
+
#line 158 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1121
|
+
{
|
1122
|
+
MARK(last_newline, p + 1);
|
1123
|
+
}
|
1124
|
+
break;
|
1125
|
+
case 16:
|
1126
|
+
#line 162 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1127
|
+
{
|
1128
|
+
if (lexer->mark == 0) {
|
1129
|
+
MARK(mark, p);
|
1130
|
+
}
|
1131
|
+
}
|
1132
|
+
break;
|
1133
|
+
case 17:
|
1134
|
+
#line 168 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1135
|
+
{
|
1136
|
+
MARK(keyword_end, p);
|
1137
|
+
MARK(keyword_start, PTR_TO(mark));
|
1138
|
+
MARK(content_start, p + 1);
|
1139
|
+
lexer->mark = 0;
|
1140
|
+
}
|
1141
|
+
break;
|
1142
|
+
case 18:
|
1143
|
+
#line 175 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1144
|
+
{
|
1145
|
+
MARK(content_end, p);
|
1146
|
+
}
|
1147
|
+
break;
|
1148
|
+
case 19:
|
1149
|
+
#line 179 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1150
|
+
{
|
1151
|
+
p = p - 1;
|
1152
|
+
lexer->current_line = lexer->line_number;
|
1153
|
+
current_row = rb_ary_new();
|
1154
|
+
}
|
1155
|
+
break;
|
1156
|
+
case 20:
|
1157
|
+
#line 185 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1158
|
+
{
|
1159
|
+
MARK(content_start, p);
|
1160
|
+
}
|
1161
|
+
break;
|
1162
|
+
case 21:
|
1163
|
+
#line 189 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1164
|
+
{
|
1165
|
+
VALUE re_pipe, re_newline, re_backslash;
|
1166
|
+
VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p));
|
1167
|
+
rb_funcall(con, rb_intern("strip!"), 0);
|
1168
|
+
re_pipe = rb_reg_regcomp(rb_str_new2("\\\\\\|"));
|
1169
|
+
re_newline = rb_reg_regcomp(rb_str_new2("\\\\n"));
|
1170
|
+
re_backslash = rb_reg_regcomp(rb_str_new2("\\\\\\\\"));
|
1171
|
+
rb_funcall(con, rb_intern("gsub!"), 2, re_pipe, rb_str_new2("|"));
|
1172
|
+
rb_funcall(con, rb_intern("gsub!"), 2, re_newline, rb_str_new2("\n"));
|
1173
|
+
rb_funcall(con, rb_intern("gsub!"), 2, re_backslash, rb_str_new2("\\"));
|
1174
|
+
|
1175
|
+
rb_ary_push(current_row, con);
|
1176
|
+
}
|
1177
|
+
break;
|
1178
|
+
case 22:
|
1179
|
+
#line 203 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1180
|
+
{
|
1181
|
+
rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line));
|
1182
|
+
}
|
1183
|
+
break;
|
1184
|
+
case 23:
|
1185
|
+
#line 207 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1186
|
+
{
|
1187
|
+
int line;
|
1188
|
+
if (cs < lexer_first_final) {
|
1189
|
+
size_t count = 0;
|
1190
|
+
VALUE newstr_val;
|
1191
|
+
char *newstr;
|
1192
|
+
int newstr_count = 0;
|
1193
|
+
size_t len;
|
1194
|
+
const char *buff;
|
1195
|
+
if (lexer->last_newline != 0) {
|
1196
|
+
len = LEN(last_newline, eof);
|
1197
|
+
buff = PTR_TO(last_newline);
|
1198
|
+
} else {
|
1199
|
+
len = strlen(data);
|
1200
|
+
buff = data;
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
// Allocate as a ruby string so that it gets cleaned up by GC
|
1204
|
+
newstr_val = rb_str_new(buff, len);
|
1205
|
+
newstr = RSTRING_PTR(newstr_val);
|
1206
|
+
|
1207
|
+
|
1208
|
+
for (count = 0; count < len; count++) {
|
1209
|
+
if(buff[count] == 10) {
|
1210
|
+
newstr[newstr_count] = '\0'; // terminate new string at first newline found
|
1211
|
+
break;
|
1212
|
+
} else {
|
1213
|
+
if (buff[count] == '%') {
|
1214
|
+
newstr[newstr_count++] = buff[count];
|
1215
|
+
newstr[newstr_count] = buff[count];
|
1216
|
+
} else {
|
1217
|
+
newstr[newstr_count] = buff[count];
|
1218
|
+
}
|
1219
|
+
}
|
1220
|
+
newstr_count++;
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
line = lexer->line_number;
|
1224
|
+
lexer_init(lexer); // Re-initialize so we can scan again with the same lexer
|
1225
|
+
raise_lexer_error(newstr, line);
|
1226
|
+
} else {
|
1227
|
+
rb_funcall(listener, rb_intern("eof"), 0);
|
1228
|
+
}
|
1229
|
+
}
|
1230
|
+
break;
|
1231
|
+
#line 1232 "ext/gherkin_lexer_it/gherkin_lexer_it.c"
|
1232
|
+
}
|
1233
|
+
}
|
1234
|
+
|
1235
|
+
_again:
|
1236
|
+
if ( cs == 0 )
|
1237
|
+
goto _out;
|
1238
|
+
if ( ++p != pe )
|
1239
|
+
goto _resume;
|
1240
|
+
_test_eof: {}
|
1241
|
+
if ( p == eof )
|
1242
|
+
{
|
1243
|
+
const char *__acts = _lexer_actions + _lexer_eof_actions[cs];
|
1244
|
+
unsigned int __nacts = (unsigned int) *__acts++;
|
1245
|
+
while ( __nacts-- > 0 ) {
|
1246
|
+
switch ( *__acts++ ) {
|
1247
|
+
case 23:
|
1248
|
+
#line 207 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1249
|
+
{
|
1250
|
+
int line;
|
1251
|
+
if (cs < lexer_first_final) {
|
1252
|
+
size_t count = 0;
|
1253
|
+
VALUE newstr_val;
|
1254
|
+
char *newstr;
|
1255
|
+
int newstr_count = 0;
|
1256
|
+
size_t len;
|
1257
|
+
const char *buff;
|
1258
|
+
if (lexer->last_newline != 0) {
|
1259
|
+
len = LEN(last_newline, eof);
|
1260
|
+
buff = PTR_TO(last_newline);
|
1261
|
+
} else {
|
1262
|
+
len = strlen(data);
|
1263
|
+
buff = data;
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
// Allocate as a ruby string so that it gets cleaned up by GC
|
1267
|
+
newstr_val = rb_str_new(buff, len);
|
1268
|
+
newstr = RSTRING_PTR(newstr_val);
|
1269
|
+
|
1270
|
+
|
1271
|
+
for (count = 0; count < len; count++) {
|
1272
|
+
if(buff[count] == 10) {
|
1273
|
+
newstr[newstr_count] = '\0'; // terminate new string at first newline found
|
1274
|
+
break;
|
1275
|
+
} else {
|
1276
|
+
if (buff[count] == '%') {
|
1277
|
+
newstr[newstr_count++] = buff[count];
|
1278
|
+
newstr[newstr_count] = buff[count];
|
1279
|
+
} else {
|
1280
|
+
newstr[newstr_count] = buff[count];
|
1281
|
+
}
|
1282
|
+
}
|
1283
|
+
newstr_count++;
|
1284
|
+
}
|
1285
|
+
|
1286
|
+
line = lexer->line_number;
|
1287
|
+
lexer_init(lexer); // Re-initialize so we can scan again with the same lexer
|
1288
|
+
raise_lexer_error(newstr, line);
|
1289
|
+
} else {
|
1290
|
+
rb_funcall(listener, rb_intern("eof"), 0);
|
1291
|
+
}
|
1292
|
+
}
|
1293
|
+
break;
|
1294
|
+
#line 1295 "ext/gherkin_lexer_it/gherkin_lexer_it.c"
|
1295
|
+
}
|
1296
|
+
}
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
_out: {}
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
#line 426 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/it.c.rl"
|
1303
|
+
|
1304
|
+
assert(p <= pe && "data overflow after parsing execute");
|
1305
|
+
assert(lexer->content_start <= len && "content starts after data end");
|
1306
|
+
assert(lexer->mark < len && "mark is after data end");
|
1307
|
+
|
1308
|
+
// Reset lexer by re-initializing the whole thing
|
1309
|
+
lexer_init(lexer);
|
1310
|
+
|
1311
|
+
if (cs == lexer_error) {
|
1312
|
+
rb_raise(rb_eGherkinLexingError, "Invalid format, lexing fails.");
|
1313
|
+
} else {
|
1314
|
+
return Qtrue;
|
1315
|
+
}
|
1316
|
+
}
|
1317
|
+
}
|
1318
|
+
|
1319
|
+
void Init_gherkin_lexer_it()
|
1320
|
+
{
|
1321
|
+
mGherkin = rb_define_module("Gherkin");
|
1322
|
+
mGherkinLexer = rb_define_module_under(mGherkin, "Lexer");
|
1323
|
+
rb_eGherkinLexingError = rb_const_get(mGherkinLexer, rb_intern("LexingError"));
|
1324
|
+
|
1325
|
+
mCLexer = rb_define_module_under(mGherkin, "CLexer");
|
1326
|
+
cI18nLexer = rb_define_class_under(mCLexer, "It", rb_cObject);
|
1327
|
+
rb_define_alloc_func(cI18nLexer, CLexer_alloc);
|
1328
|
+
rb_define_method(cI18nLexer, "initialize", CLexer_init, 1);
|
1329
|
+
rb_define_method(cI18nLexer, "scan", CLexer_scan, 1);
|
1330
|
+
}
|
1331
|
+
|