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