gherkin 2.4.18 → 2.4.20

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