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