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