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