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