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