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