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