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