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