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