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