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