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