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