gherkin 2.9.3 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.10.0](https://github.com/cucumber/gherkin/compare/v2.9.3...v2.10.0)
2
+
3
+ * [Core] Added Malay language support. ([#176](https://github.com/cucumber/gherkin/pull/176) Choon Siong)
4
+ * [JRuby] Fixed `I18n.language_table` so that `cucumber --i18n help` works again on JRuby. ([cucumber #272](https://github.com/cucumber/cucumber/issues/272) Aslak Hellesøy)
5
+ * [Java] Line numbers are Integer instead of int or Long (Aslak Hellesøy)
6
+ * [Java, Ruby] Fix for exception when an argument is missing. ([#171](https://github.com/cucumber/gherkin/pull/171) Matt Nathan, Aslak Hellesøy)
7
+
1
8
  ## [2.9.3](https://github.com/cucumber/gherkin/compare/v2.9.2...v2.9.3)
2
9
 
3
10
  * [Java] Fixed a bug in PrettyFormatter.setMonochrome(false) (Aslak Hellesøy)
data/README.md CHANGED
@@ -8,7 +8,7 @@ A fast lexer and parser for the Gherkin language based on Ragel. Gherkin is two
8
8
 
9
9
  Supported platforms:
10
10
 
11
- * [Ruby](https://rubygems.org/gems/gherkin) 1.8.6-1.9.3 (MRI, JRuby, REE, Rubinius)
11
+ * [Ruby](https://rubygems.org/gems/gherkin) 1.8.7-1.9.3 (MRI, JRuby, REE, Rubinius)
12
12
  * [Pure Java](http://search.maven.org/#search%7Cga%7C1%7Cgherkin) (jar file)
13
13
  * [JavaScript](http://search.npmjs.org/#/gherkin) (Tested with V8/node.js/Chrome, but might work on other JavaScript engines)
14
14
  * [.NET](http://nuget.org/List/Packages/gherkin) (dll file)
@@ -55,7 +55,7 @@ The jar file is in the central Maven repo.
55
55
  <dependency>
56
56
  <groupId>info.cukes</groupId>
57
57
  <artifactId>gherkin</artifactId>
58
- <version>2.9.3</version>
58
+ <version>2.10.0</version>
59
59
  </dependency>
60
60
 
61
61
  You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
@@ -127,21 +127,15 @@ Now you can build the jar with:
127
127
 
128
128
  In order to build and test Gherkin for JavaScript you must install:
129
129
 
130
- * Node.js (0.4.6 or higher)
131
- * NPM (0.3.18 or higher)
130
+ * Node.js (0.6.17 or higher with npm)
132
131
  * Ragel with JavaScript support: http://github.com/dominicmarks/ragel-js
133
- ** Make sure you have `autoconf` and `automake` (`brew install automake && brew install autoconf`)
134
- ** Make sure you have the official ragel (`brew install ragel`)
135
- ** Make sure you have kelbt (`brew install kelbt`). If that fails, install manually from http://www.complang.org/kelbt/
136
- ** `cd ragel-js/ragel-svn && ./autogen.sh && ./configure --disable-manual`
132
+ * Make sure you have `autoconf` and `automake` (`brew install automake`)
133
+ * Make sure you have the official ragel (`brew install ragel`)
134
+ * Make sure you have kelbt (`brew install kelbt`). If that fails, install manually from http://www.complang.org/kelbt/
135
+ * `cd ragel-js/ragel-svn && ./autogen.sh && ./configure --disable-manual`
136
+ * `make && make install`
137
137
  * Define the GHERKIN_JS environment variable in your shell (any value will do)
138
138
 
139
- Prepare the environment:
140
-
141
- pushd js
142
- npm install
143
- popd
144
-
145
139
  Now you can build the JavaScript with:
146
140
 
147
141
  rake js
@@ -152,13 +146,15 @@ And you can try it out with node.js:
152
146
 
153
147
  If you're hacking and just want to rebuild the English parser:
154
148
 
155
- rake js/lib/gherkin/lexer/en.js
149
+ rake js/lib/gherkin/lexer/en.js
156
150
 
157
151
  TODO: Make all specs pass with js lexer - replace 'c(listener)' with 'js(listener)' in i18n.rb
158
152
 
159
153
  ### .NET dll
160
154
 
161
- You must install Mono SDK 2.10.8 or newer.
155
+ You must install Mono SDK 2.10.8. The OS X package installer is not recommended as it modifies your system PATH and makes Homebrew unhappy. Install with homebrew instead:
156
+
157
+ brew install ikvm/mono.rb
162
158
 
163
159
  You must also download NuGet.exe from [CodePlex](http://nuget.codeplex.com/releases) and place it in `/usr/local/nuget/NuGet.exe`. When it's installed, update it and register your NuGet API Key:
164
160
 
@@ -166,69 +162,77 @@ You must also download NuGet.exe from [CodePlex](http://nuget.codeplex.com/relea
166
162
  mono /usr/local/nuget/NuGet.exe Update -self
167
163
 
168
164
  # The key is at https://nuget.org/account
169
- mono /usr/local/nuget/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
165
+ mono --runtime=v4.0.30319 /usr/local/nuget/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
170
166
 
171
167
  Now you can build the .NET dll with:
172
168
 
169
+ mkdir release
173
170
  rake ikvm
171
+ rake release/nuspec/lib/gherkin.dll
174
172
 
175
- This should put the dll into `release/nuspec/lib/gherkin.dll`
173
+ This should build `release/nuspec/lib/gherkin.dll`
176
174
 
177
175
  ### MinGW Rubies (for Windows gems)
178
176
 
179
- In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we first need to install MinGW.
180
- Follow the MinGW installation instructions from the [rake-compiler](https://github.com/luislavena/rake-compiler) project.
181
- IMPORTANT! You may have to get an older version - gcc 4.7.0 is experimental. See [this issue](https://github.com/luislavena/rake-compiler/issues/50)
177
+ In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we first need to install MinGW:
182
178
 
183
- Now, make sure you have openssl installed:
179
+ ./install_mingw_os_x.sh
180
+
181
+ Now, make sure you have openssl installed - it's needed to build the rubies.
184
182
 
185
183
  brew install openssl
186
184
 
187
185
  Next, we're going to install Ruby 1.8.7 and Ruby 1.9.3 for MinGW. We need both versions so we can build Windows binaries for both.
188
186
  OS X Lion (or later) doesn't ship with an LLVM free gcc, which you will need in order to install ruby 1.8.7. We can install it with:
189
187
 
190
- brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/apple-gcc42.rb
191
- export CC=gcc-4.2
188
+ brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
192
189
 
193
190
  For more info see:
194
191
 
195
192
  * http://stackoverflow.com/questions/6170813/why-cant-i-install-rails-on-lion-using-rvm
196
193
  * https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
197
194
 
198
- Now we need to set up [rake-compiler](http://github.com/luislavena/rake-compiler/)
199
- First, set the `CC` variable to your mingw32-gcc, for example:
200
-
201
- export CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc
195
+ Now we're ready to install the Windows rubies:
202
196
 
203
- Now, let's install some rubies:
197
+ unset GHERKIN_JS
204
198
 
205
- # 1.8.7
206
- rvm install 1.8.7-p352
207
- rvm use 1.8.7-p352
199
+ # 1.9.3
200
+ rvm install 1.9.3-p194
201
+ rvm use 1.9.3-p194
208
202
  rvm gemset create cucumber
209
203
  rvm gemset use cucumber
210
204
  gem install bundler
211
- unset GHERKIN_JS
212
205
  bundle install
213
- rake-compiler cross-ruby VERSION=1.8.7-p352
206
+ PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake-compiler cross-ruby VERSION=1.9.3-p194
214
207
 
215
- # 1.9.3
216
- rvm install 1.9.3-p125
217
- rvm use 1.9.3-p125
208
+ # 1.8.7
209
+ CC=gcc-4.2 rvm install 1.8.7-p352
210
+ rvm use 1.8.7-p352
218
211
  rvm gemset create cucumber
219
212
  rvm gemset use cucumber
220
213
  gem install bundler
221
- unset GHERKIN_JS
222
214
  bundle install
223
- rake-compiler cross-ruby VERSION=1.9.3-p125
215
+ PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake-compiler cross-ruby VERSION=1.8.7-p352
224
216
 
225
217
  Now you can build Windows gems:
226
218
 
227
219
  rake compile
220
+ mkdir release
228
221
  rake gems:win
229
222
 
230
223
  ## Release process
231
224
 
225
+ Make sure you have access to all the servers where packages are being uploaded:
226
+
227
+ * npm registry: `npm login`
228
+ * rubygems.org: `gem push`
229
+ * cukes.info: `ssh cukes.info`
230
+ * sonatype: Check `~/.m2/settings.xml` and that you have gnupg (OS X users: Install [GPGTools](http://www.gpgtools.org/installer/index.html))
231
+ * Make sure you have a key [with no sub-key](https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven)
232
+ * nuget: See .NET section above
233
+
234
+ Now we can release:
235
+
232
236
  * Make sure GHERKIN_JS is defined (see JavaScript section above)
233
237
  * Bump version in:
234
238
  * This file (Installation/Java section)
@@ -15,5 +15,5 @@ sources.each do |s|
15
15
  parser.parse(IO.read(path), path, 0)
16
16
  end
17
17
 
18
- formatter.close
18
+ formatter.done
19
19
  puts JSON.pretty_generate(JSON.parse(io.string))
@@ -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|clang/
4
+ dir_config("gherkin_lexer_bm")
5
+ have_library("c", "main")
6
+ create_makefile("gherkin_lexer_bm")
@@ -0,0 +1,1337 @@
1
+
2
+ #line 1 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.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/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
84
+
85
+
86
+ /** Data **/
87
+
88
+ #line 89 "ext/gherkin_lexer_bm/gherkin_lexer_bm.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
+ 0, 11, 3, 17, 14, 15, 4, 1,
107
+ 14, 15, 18, 4, 4, 5, 14, 15,
108
+ 4, 17, 0, 14, 15, 5, 17, 0,
109
+ 11, 14, 15
110
+ };
111
+
112
+ static const short _lexer_key_offsets[] = {
113
+ 0, 0, 21, 22, 23, 43, 44, 45,
114
+ 47, 49, 54, 59, 64, 69, 73, 77,
115
+ 79, 80, 81, 82, 83, 84, 85, 86,
116
+ 87, 88, 89, 90, 91, 92, 93, 94,
117
+ 95, 97, 99, 104, 111, 116, 117, 118,
118
+ 119, 120, 121, 122, 123, 124, 125, 126,
119
+ 127, 128, 129, 130, 131, 132, 133, 140,
120
+ 142, 144, 146, 148, 150, 152, 172, 173,
121
+ 174, 175, 176, 177, 178, 179, 180, 181,
122
+ 182, 194, 196, 198, 200, 202, 204, 206,
123
+ 208, 210, 212, 214, 216, 218, 220, 222,
124
+ 224, 226, 228, 230, 232, 234, 236, 238,
125
+ 240, 242, 244, 246, 248, 250, 252, 254,
126
+ 256, 258, 260, 262, 264, 266, 268, 270,
127
+ 272, 274, 276, 278, 280, 282, 284, 286,
128
+ 288, 290, 292, 294, 296, 298, 300, 302,
129
+ 304, 306, 308, 309, 310, 311, 312, 313,
130
+ 314, 315, 316, 317, 318, 319, 320, 321,
131
+ 322, 323, 324, 325, 326, 327, 328, 329,
132
+ 345, 347, 349, 351, 353, 355, 357, 359,
133
+ 361, 363, 365, 367, 369, 371, 373, 375,
134
+ 377, 379, 381, 383, 385, 387, 389, 391,
135
+ 393, 395, 397, 399, 401, 403, 405, 407,
136
+ 409, 411, 413, 415, 417, 419, 421, 423,
137
+ 425, 427, 429, 431, 433, 435, 437, 439,
138
+ 441, 443, 445, 447, 449, 451, 453, 455,
139
+ 457, 459, 461, 463, 465, 466, 467, 468,
140
+ 469, 470, 471, 472, 473, 474, 475, 476,
141
+ 477, 478, 479, 480, 481, 482, 483, 484,
142
+ 485, 486, 487, 502, 504, 506, 508, 510,
143
+ 512, 514, 516, 518, 520, 522, 524, 526,
144
+ 528, 530, 532, 534, 536, 538, 540, 542,
145
+ 544, 546, 548, 550, 552, 554, 556, 558,
146
+ 560, 562, 564, 566, 568, 570, 572, 574,
147
+ 576, 578, 580, 582, 584, 586, 588, 590,
148
+ 592, 594, 596, 597, 598, 599, 600, 601,
149
+ 602, 603, 604, 605, 622, 624, 626, 628,
150
+ 630, 632, 634, 636, 638, 640, 642, 644,
151
+ 646, 648, 650, 652, 654, 656, 658, 660,
152
+ 662, 664, 666, 668, 670, 672, 674, 676,
153
+ 678, 680, 682, 684, 686, 688, 690, 692,
154
+ 694, 696, 698, 700, 702, 704, 706, 708,
155
+ 710, 712, 714, 716, 718, 720, 722, 724,
156
+ 726, 728, 730, 732, 734, 736, 738, 740,
157
+ 742, 744, 746, 748, 750, 752, 754, 756,
158
+ 758, 760, 762, 764, 766, 768, 769, 770,
159
+ 771, 772, 776, 782, 785, 787, 793, 813
160
+ };
161
+
162
+ static const char _lexer_trans_keys[] = {
163
+ -17, 10, 32, 34, 35, 37, 42, 64,
164
+ 65, 66, 67, 68, 70, 75, 76, 77,
165
+ 83, 84, 124, 9, 13, -69, -65, 10,
166
+ 32, 34, 35, 37, 42, 64, 65, 66,
167
+ 67, 68, 70, 75, 76, 77, 83, 84,
168
+ 124, 9, 13, 34, 34, 10, 13, 10,
169
+ 13, 10, 32, 34, 9, 13, 10, 32,
170
+ 34, 9, 13, 10, 32, 34, 9, 13,
171
+ 10, 32, 34, 9, 13, 10, 32, 9,
172
+ 13, 10, 32, 9, 13, 10, 13, 10,
173
+ 95, 70, 69, 65, 84, 85, 82, 69,
174
+ 95, 69, 78, 68, 95, 37, 32, 10,
175
+ 13, 10, 13, 13, 32, 64, 9, 10,
176
+ 9, 10, 13, 32, 64, 11, 12, 10,
177
+ 32, 64, 9, 13, 112, 97, 98, 105,
178
+ 108, 97, 97, 103, 105, 111, 110, 116,
179
+ 111, 104, 58, 10, 10, 10, 32, 35,
180
+ 70, 124, 9, 13, 10, 117, 10, 110,
181
+ 10, 103, 10, 115, 10, 105, 10, 58,
182
+ 10, 32, 34, 35, 37, 42, 64, 65,
183
+ 66, 67, 68, 70, 75, 76, 77, 83,
184
+ 84, 124, 9, 13, 97, 110, 117, 110,
185
+ 103, 115, 105, 58, 10, 10, 10, 32,
186
+ 35, 37, 64, 67, 70, 76, 77, 83,
187
+ 9, 13, 10, 95, 10, 70, 10, 69,
188
+ 10, 65, 10, 84, 10, 85, 10, 82,
189
+ 10, 69, 10, 95, 10, 69, 10, 78,
190
+ 10, 68, 10, 95, 10, 37, 10, 111,
191
+ 10, 110, 10, 116, 10, 111, 10, 104,
192
+ 10, 58, 10, 117, 10, 110, 10, 103,
193
+ 10, 115, 10, 105, 10, 97, 10, 116,
194
+ 10, 97, 10, 114, 10, 32, 10, 66,
195
+ 10, 101, 10, 108, 10, 97, 10, 107,
196
+ 10, 97, 10, 110, 10, 103, 10, 101,
197
+ 10, 110, 10, 103, 10, 103, 10, 97,
198
+ 10, 114, 10, 105, 10, 115, 10, 107,
199
+ 10, 97, 10, 110, 10, 32, 10, 83,
200
+ 10, 101, 10, 110, 10, 97, 10, 114,
201
+ 10, 105, 10, 111, 101, 109, 117, 100,
202
+ 105, 97, 116, 97, 114, 32, 66, 101,
203
+ 108, 97, 107, 97, 110, 103, 58, 10,
204
+ 10, 10, 32, 35, 37, 42, 64, 65,
205
+ 66, 68, 70, 75, 77, 83, 84, 9,
206
+ 13, 10, 95, 10, 70, 10, 69, 10,
207
+ 65, 10, 84, 10, 85, 10, 82, 10,
208
+ 69, 10, 95, 10, 69, 10, 78, 10,
209
+ 68, 10, 95, 10, 37, 10, 32, 10,
210
+ 112, 10, 97, 10, 98, 10, 105, 10,
211
+ 108, 10, 97, 10, 97, 10, 103, 10,
212
+ 105, 10, 97, 10, 110, 10, 117, 10,
213
+ 110, 10, 103, 10, 115, 10, 105, 10,
214
+ 58, 10, 101, 10, 109, 10, 117, 10,
215
+ 100, 10, 105, 10, 101, 10, 110, 10,
216
+ 103, 10, 103, 10, 97, 10, 114, 10,
217
+ 105, 10, 115, 10, 107, 10, 97, 10,
218
+ 110, 10, 32, 10, 83, 10, 101, 10,
219
+ 110, 10, 97, 10, 114, 10, 105, 10,
220
+ 111, 10, 101, 10, 116, 10, 97, 10,
221
+ 112, 101, 110, 103, 103, 97, 114, 105,
222
+ 115, 107, 97, 110, 32, 83, 101, 110,
223
+ 97, 114, 105, 111, 58, 10, 10, 10,
224
+ 32, 35, 37, 42, 64, 65, 66, 68,
225
+ 70, 75, 83, 84, 9, 13, 10, 95,
226
+ 10, 70, 10, 69, 10, 65, 10, 84,
227
+ 10, 85, 10, 82, 10, 69, 10, 95,
228
+ 10, 69, 10, 78, 10, 68, 10, 95,
229
+ 10, 37, 10, 32, 10, 112, 10, 97,
230
+ 10, 98, 10, 105, 10, 108, 10, 97,
231
+ 10, 97, 10, 103, 10, 105, 10, 97,
232
+ 10, 110, 10, 117, 10, 110, 10, 103,
233
+ 10, 115, 10, 105, 10, 58, 10, 101,
234
+ 10, 109, 10, 117, 10, 100, 10, 105,
235
+ 10, 101, 10, 110, 10, 97, 10, 114,
236
+ 10, 105, 10, 111, 10, 101, 10, 116,
237
+ 10, 97, 10, 112, 101, 110, 97, 114,
238
+ 105, 111, 58, 10, 10, 10, 32, 35,
239
+ 37, 42, 64, 65, 66, 68, 70, 75,
240
+ 76, 77, 83, 84, 9, 13, 10, 95,
241
+ 10, 70, 10, 69, 10, 65, 10, 84,
242
+ 10, 85, 10, 82, 10, 69, 10, 95,
243
+ 10, 69, 10, 78, 10, 68, 10, 95,
244
+ 10, 37, 10, 32, 10, 112, 10, 97,
245
+ 10, 98, 10, 105, 10, 108, 10, 97,
246
+ 10, 97, 10, 103, 10, 105, 10, 97,
247
+ 10, 110, 10, 117, 10, 110, 10, 103,
248
+ 10, 115, 10, 105, 10, 58, 10, 101,
249
+ 10, 109, 10, 117, 10, 100, 10, 105,
250
+ 10, 97, 10, 116, 10, 97, 10, 114,
251
+ 10, 32, 10, 66, 10, 101, 10, 108,
252
+ 10, 97, 10, 107, 10, 97, 10, 110,
253
+ 10, 103, 10, 101, 10, 110, 10, 103,
254
+ 10, 103, 10, 97, 10, 114, 10, 105,
255
+ 10, 115, 10, 107, 10, 97, 10, 110,
256
+ 10, 32, 10, 83, 10, 101, 10, 110,
257
+ 10, 97, 10, 114, 10, 105, 10, 111,
258
+ 10, 101, 10, 116, 10, 97, 10, 112,
259
+ 101, 116, 97, 112, 32, 124, 9, 13,
260
+ 10, 32, 92, 124, 9, 13, 10, 92,
261
+ 124, 10, 92, 10, 32, 92, 124, 9,
262
+ 13, 10, 32, 34, 35, 37, 42, 64,
263
+ 65, 66, 67, 68, 70, 75, 76, 77,
264
+ 83, 84, 124, 9, 13, 0
265
+ };
266
+
267
+ static const char _lexer_single_lengths[] = {
268
+ 0, 19, 1, 1, 18, 1, 1, 2,
269
+ 2, 3, 3, 3, 3, 2, 2, 2,
270
+ 1, 1, 1, 1, 1, 1, 1, 1,
271
+ 1, 1, 1, 1, 1, 1, 1, 1,
272
+ 2, 2, 3, 5, 3, 1, 1, 1,
273
+ 1, 1, 1, 1, 1, 1, 1, 1,
274
+ 1, 1, 1, 1, 1, 1, 5, 2,
275
+ 2, 2, 2, 2, 2, 18, 1, 1,
276
+ 1, 1, 1, 1, 1, 1, 1, 1,
277
+ 10, 2, 2, 2, 2, 2, 2, 2,
278
+ 2, 2, 2, 2, 2, 2, 2, 2,
279
+ 2, 2, 2, 2, 2, 2, 2, 2,
280
+ 2, 2, 2, 2, 2, 2, 2, 2,
281
+ 2, 2, 2, 2, 2, 2, 2, 2,
282
+ 2, 2, 2, 2, 2, 2, 2, 2,
283
+ 2, 2, 2, 2, 2, 2, 2, 2,
284
+ 2, 2, 1, 1, 1, 1, 1, 1,
285
+ 1, 1, 1, 1, 1, 1, 1, 1,
286
+ 1, 1, 1, 1, 1, 1, 1, 14,
287
+ 2, 2, 2, 2, 2, 2, 2, 2,
288
+ 2, 2, 2, 2, 2, 2, 2, 2,
289
+ 2, 2, 2, 2, 2, 2, 2, 2,
290
+ 2, 2, 2, 2, 2, 2, 2, 2,
291
+ 2, 2, 2, 2, 2, 2, 2, 2,
292
+ 2, 2, 2, 2, 2, 2, 2, 2,
293
+ 2, 2, 2, 2, 2, 2, 2, 2,
294
+ 2, 2, 2, 2, 1, 1, 1, 1,
295
+ 1, 1, 1, 1, 1, 1, 1, 1,
296
+ 1, 1, 1, 1, 1, 1, 1, 1,
297
+ 1, 1, 13, 2, 2, 2, 2, 2,
298
+ 2, 2, 2, 2, 2, 2, 2, 2,
299
+ 2, 2, 2, 2, 2, 2, 2, 2,
300
+ 2, 2, 2, 2, 2, 2, 2, 2,
301
+ 2, 2, 2, 2, 2, 2, 2, 2,
302
+ 2, 2, 2, 2, 2, 2, 2, 2,
303
+ 2, 2, 1, 1, 1, 1, 1, 1,
304
+ 1, 1, 1, 15, 2, 2, 2, 2,
305
+ 2, 2, 2, 2, 2, 2, 2, 2,
306
+ 2, 2, 2, 2, 2, 2, 2, 2,
307
+ 2, 2, 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, 2,
311
+ 2, 2, 2, 2, 2, 2, 2, 2,
312
+ 2, 2, 2, 2, 2, 2, 2, 2,
313
+ 2, 2, 2, 2, 2, 1, 1, 1,
314
+ 1, 2, 4, 3, 2, 4, 18, 0
315
+ };
316
+
317
+ static const char _lexer_range_lengths[] = {
318
+ 0, 1, 0, 0, 1, 0, 0, 0,
319
+ 0, 1, 1, 1, 1, 1, 1, 0,
320
+ 0, 0, 0, 0, 0, 0, 0, 0,
321
+ 0, 0, 0, 0, 0, 0, 0, 0,
322
+ 0, 0, 1, 1, 1, 0, 0, 0,
323
+ 0, 0, 0, 0, 0, 0, 0, 0,
324
+ 0, 0, 0, 0, 0, 0, 1, 0,
325
+ 0, 0, 0, 0, 0, 1, 0, 0,
326
+ 0, 0, 0, 0, 0, 0, 0, 0,
327
+ 1, 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, 0, 0, 0,
333
+ 0, 0, 0, 0, 0, 0, 0, 0,
334
+ 0, 0, 0, 0, 0, 0, 0, 0,
335
+ 0, 0, 0, 0, 0, 0, 0, 0,
336
+ 0, 0, 0, 0, 0, 0, 0, 1,
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, 0, 0, 0, 0,
345
+ 0, 0, 0, 0, 0, 0, 0, 0,
346
+ 0, 0, 0, 0, 0, 0, 0, 0,
347
+ 0, 0, 1, 0, 0, 0, 0, 0,
348
+ 0, 0, 0, 0, 0, 0, 0, 0,
349
+ 0, 0, 0, 0, 0, 0, 0, 0,
350
+ 0, 0, 0, 0, 0, 0, 0, 0,
351
+ 0, 0, 0, 0, 0, 0, 0, 0,
352
+ 0, 0, 0, 0, 0, 0, 0, 0,
353
+ 0, 0, 0, 0, 0, 0, 0, 0,
354
+ 0, 0, 0, 1, 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
+ 0, 0, 0, 0, 0, 0, 0, 0,
361
+ 0, 0, 0, 0, 0, 0, 0, 0,
362
+ 0, 0, 0, 0, 0, 0, 0, 0,
363
+ 0, 0, 0, 0, 0, 0, 0, 0,
364
+ 0, 1, 1, 0, 0, 1, 1, 0
365
+ };
366
+
367
+ static const short _lexer_index_offsets[] = {
368
+ 0, 0, 21, 23, 25, 45, 47, 49,
369
+ 52, 55, 60, 65, 70, 75, 79, 83,
370
+ 86, 88, 90, 92, 94, 96, 98, 100,
371
+ 102, 104, 106, 108, 110, 112, 114, 116,
372
+ 118, 121, 124, 129, 136, 141, 143, 145,
373
+ 147, 149, 151, 153, 155, 157, 159, 161,
374
+ 163, 165, 167, 169, 171, 173, 175, 182,
375
+ 185, 188, 191, 194, 197, 200, 220, 222,
376
+ 224, 226, 228, 230, 232, 234, 236, 238,
377
+ 240, 252, 255, 258, 261, 264, 267, 270,
378
+ 273, 276, 279, 282, 285, 288, 291, 294,
379
+ 297, 300, 303, 306, 309, 312, 315, 318,
380
+ 321, 324, 327, 330, 333, 336, 339, 342,
381
+ 345, 348, 351, 354, 357, 360, 363, 366,
382
+ 369, 372, 375, 378, 381, 384, 387, 390,
383
+ 393, 396, 399, 402, 405, 408, 411, 414,
384
+ 417, 420, 423, 425, 427, 429, 431, 433,
385
+ 435, 437, 439, 441, 443, 445, 447, 449,
386
+ 451, 453, 455, 457, 459, 461, 463, 465,
387
+ 481, 484, 487, 490, 493, 496, 499, 502,
388
+ 505, 508, 511, 514, 517, 520, 523, 526,
389
+ 529, 532, 535, 538, 541, 544, 547, 550,
390
+ 553, 556, 559, 562, 565, 568, 571, 574,
391
+ 577, 580, 583, 586, 589, 592, 595, 598,
392
+ 601, 604, 607, 610, 613, 616, 619, 622,
393
+ 625, 628, 631, 634, 637, 640, 643, 646,
394
+ 649, 652, 655, 658, 661, 663, 665, 667,
395
+ 669, 671, 673, 675, 677, 679, 681, 683,
396
+ 685, 687, 689, 691, 693, 695, 697, 699,
397
+ 701, 703, 705, 720, 723, 726, 729, 732,
398
+ 735, 738, 741, 744, 747, 750, 753, 756,
399
+ 759, 762, 765, 768, 771, 774, 777, 780,
400
+ 783, 786, 789, 792, 795, 798, 801, 804,
401
+ 807, 810, 813, 816, 819, 822, 825, 828,
402
+ 831, 834, 837, 840, 843, 846, 849, 852,
403
+ 855, 858, 861, 863, 865, 867, 869, 871,
404
+ 873, 875, 877, 879, 896, 899, 902, 905,
405
+ 908, 911, 914, 917, 920, 923, 926, 929,
406
+ 932, 935, 938, 941, 944, 947, 950, 953,
407
+ 956, 959, 962, 965, 968, 971, 974, 977,
408
+ 980, 983, 986, 989, 992, 995, 998, 1001,
409
+ 1004, 1007, 1010, 1013, 1016, 1019, 1022, 1025,
410
+ 1028, 1031, 1034, 1037, 1040, 1043, 1046, 1049,
411
+ 1052, 1055, 1058, 1061, 1064, 1067, 1070, 1073,
412
+ 1076, 1079, 1082, 1085, 1088, 1091, 1094, 1097,
413
+ 1100, 1103, 1106, 1109, 1112, 1115, 1117, 1119,
414
+ 1121, 1123, 1127, 1133, 1137, 1140, 1146, 1166
415
+ };
416
+
417
+ static const short _lexer_trans_targs[] = {
418
+ 2, 4, 4, 5, 15, 17, 31, 34,
419
+ 37, 43, 46, 62, 64, 130, 135, 212,
420
+ 282, 365, 369, 4, 0, 3, 0, 4,
421
+ 0, 4, 4, 5, 15, 17, 31, 34,
422
+ 37, 43, 46, 62, 64, 130, 135, 212,
423
+ 282, 365, 369, 4, 0, 6, 0, 7,
424
+ 0, 9, 8, 8, 9, 8, 8, 10,
425
+ 10, 11, 10, 10, 10, 10, 11, 10,
426
+ 10, 10, 10, 12, 10, 10, 10, 10,
427
+ 13, 10, 10, 4, 14, 14, 0, 4,
428
+ 14, 14, 0, 4, 16, 15, 4, 0,
429
+ 18, 0, 19, 0, 20, 0, 21, 0,
430
+ 22, 0, 23, 0, 24, 0, 25, 0,
431
+ 26, 0, 27, 0, 28, 0, 29, 0,
432
+ 30, 0, 375, 0, 32, 0, 4, 16,
433
+ 33, 4, 16, 33, 0, 0, 0, 0,
434
+ 35, 36, 4, 36, 36, 34, 35, 35,
435
+ 4, 36, 34, 36, 0, 38, 0, 39,
436
+ 0, 40, 0, 41, 0, 42, 0, 31,
437
+ 0, 44, 0, 45, 0, 31, 0, 47,
438
+ 0, 48, 0, 49, 0, 50, 0, 51,
439
+ 0, 52, 0, 54, 53, 54, 53, 54,
440
+ 54, 4, 55, 4, 54, 53, 54, 56,
441
+ 53, 54, 57, 53, 54, 58, 53, 54,
442
+ 59, 53, 54, 60, 53, 54, 61, 53,
443
+ 4, 4, 5, 15, 17, 31, 34, 37,
444
+ 43, 46, 62, 64, 130, 135, 212, 282,
445
+ 365, 369, 4, 0, 63, 0, 31, 0,
446
+ 65, 0, 66, 0, 67, 0, 68, 0,
447
+ 69, 0, 70, 0, 72, 71, 72, 71,
448
+ 72, 72, 4, 73, 4, 87, 93, 98,
449
+ 111, 124, 72, 71, 72, 74, 71, 72,
450
+ 75, 71, 72, 76, 71, 72, 77, 71,
451
+ 72, 78, 71, 72, 79, 71, 72, 80,
452
+ 71, 72, 81, 71, 72, 82, 71, 72,
453
+ 83, 71, 72, 84, 71, 72, 85, 71,
454
+ 72, 86, 71, 72, 4, 71, 72, 88,
455
+ 71, 72, 89, 71, 72, 90, 71, 72,
456
+ 91, 71, 72, 92, 71, 72, 61, 71,
457
+ 72, 94, 71, 72, 95, 71, 72, 96,
458
+ 71, 72, 97, 71, 72, 92, 71, 72,
459
+ 99, 71, 72, 100, 71, 72, 101, 71,
460
+ 72, 102, 71, 72, 103, 71, 72, 104,
461
+ 71, 72, 105, 71, 72, 106, 71, 72,
462
+ 107, 71, 72, 108, 71, 72, 109, 71,
463
+ 72, 110, 71, 72, 92, 71, 72, 112,
464
+ 71, 72, 113, 71, 72, 114, 71, 72,
465
+ 115, 71, 72, 116, 71, 72, 117, 71,
466
+ 72, 118, 71, 72, 119, 71, 72, 120,
467
+ 71, 72, 121, 71, 72, 122, 71, 72,
468
+ 123, 71, 72, 124, 71, 72, 125, 71,
469
+ 72, 126, 71, 72, 127, 71, 72, 128,
470
+ 71, 72, 129, 71, 72, 92, 71, 131,
471
+ 0, 132, 0, 133, 0, 134, 0, 62,
472
+ 0, 136, 0, 137, 0, 138, 0, 139,
473
+ 0, 140, 0, 141, 0, 142, 0, 143,
474
+ 0, 144, 0, 145, 0, 146, 0, 147,
475
+ 0, 148, 0, 149, 0, 151, 150, 151,
476
+ 150, 151, 151, 4, 152, 166, 4, 167,
477
+ 173, 176, 178, 184, 189, 202, 208, 151,
478
+ 150, 151, 153, 150, 151, 154, 150, 151,
479
+ 155, 150, 151, 156, 150, 151, 157, 150,
480
+ 151, 158, 150, 151, 159, 150, 151, 160,
481
+ 150, 151, 161, 150, 151, 162, 150, 151,
482
+ 163, 150, 151, 164, 150, 151, 165, 150,
483
+ 151, 4, 150, 151, 61, 150, 151, 168,
484
+ 150, 151, 169, 150, 151, 170, 150, 151,
485
+ 171, 150, 151, 172, 150, 151, 166, 150,
486
+ 151, 174, 150, 151, 175, 150, 151, 166,
487
+ 150, 151, 177, 150, 151, 166, 150, 151,
488
+ 179, 150, 151, 180, 150, 151, 181, 150,
489
+ 151, 182, 150, 151, 183, 150, 151, 61,
490
+ 150, 151, 185, 150, 151, 186, 150, 151,
491
+ 187, 150, 151, 188, 150, 151, 176, 150,
492
+ 151, 190, 150, 151, 191, 150, 151, 192,
493
+ 150, 151, 193, 150, 151, 194, 150, 151,
494
+ 195, 150, 151, 196, 150, 151, 197, 150,
495
+ 151, 198, 150, 151, 199, 150, 151, 200,
496
+ 150, 151, 201, 150, 151, 202, 150, 151,
497
+ 203, 150, 151, 204, 150, 151, 205, 150,
498
+ 151, 206, 150, 151, 207, 150, 151, 183,
499
+ 150, 151, 209, 150, 151, 210, 150, 151,
500
+ 211, 150, 151, 175, 150, 213, 0, 214,
501
+ 0, 215, 0, 216, 0, 217, 0, 218,
502
+ 0, 219, 0, 220, 0, 221, 0, 222,
503
+ 0, 223, 0, 224, 0, 225, 0, 226,
504
+ 0, 227, 0, 228, 0, 229, 0, 230,
505
+ 0, 231, 0, 232, 0, 234, 233, 234,
506
+ 233, 234, 234, 4, 235, 249, 4, 250,
507
+ 256, 259, 261, 267, 272, 278, 234, 233,
508
+ 234, 236, 233, 234, 237, 233, 234, 238,
509
+ 233, 234, 239, 233, 234, 240, 233, 234,
510
+ 241, 233, 234, 242, 233, 234, 243, 233,
511
+ 234, 244, 233, 234, 245, 233, 234, 246,
512
+ 233, 234, 247, 233, 234, 248, 233, 234,
513
+ 4, 233, 234, 61, 233, 234, 251, 233,
514
+ 234, 252, 233, 234, 253, 233, 234, 254,
515
+ 233, 234, 255, 233, 234, 249, 233, 234,
516
+ 257, 233, 234, 258, 233, 234, 249, 233,
517
+ 234, 260, 233, 234, 249, 233, 234, 262,
518
+ 233, 234, 263, 233, 234, 264, 233, 234,
519
+ 265, 233, 234, 266, 233, 234, 61, 233,
520
+ 234, 268, 233, 234, 269, 233, 234, 270,
521
+ 233, 234, 271, 233, 234, 259, 233, 234,
522
+ 273, 233, 234, 274, 233, 234, 275, 233,
523
+ 234, 276, 233, 234, 277, 233, 234, 266,
524
+ 233, 234, 279, 233, 234, 280, 233, 234,
525
+ 281, 233, 234, 258, 233, 283, 0, 284,
526
+ 0, 285, 0, 286, 0, 287, 0, 288,
527
+ 0, 289, 0, 291, 290, 291, 290, 291,
528
+ 291, 4, 292, 306, 4, 307, 313, 316,
529
+ 318, 324, 329, 342, 355, 361, 291, 290,
530
+ 291, 293, 290, 291, 294, 290, 291, 295,
531
+ 290, 291, 296, 290, 291, 297, 290, 291,
532
+ 298, 290, 291, 299, 290, 291, 300, 290,
533
+ 291, 301, 290, 291, 302, 290, 291, 303,
534
+ 290, 291, 304, 290, 291, 305, 290, 291,
535
+ 4, 290, 291, 61, 290, 291, 308, 290,
536
+ 291, 309, 290, 291, 310, 290, 291, 311,
537
+ 290, 291, 312, 290, 291, 306, 290, 291,
538
+ 314, 290, 291, 315, 290, 291, 306, 290,
539
+ 291, 317, 290, 291, 306, 290, 291, 319,
540
+ 290, 291, 320, 290, 291, 321, 290, 291,
541
+ 322, 290, 291, 323, 290, 291, 61, 290,
542
+ 291, 325, 290, 291, 326, 290, 291, 327,
543
+ 290, 291, 328, 290, 291, 316, 290, 291,
544
+ 330, 290, 291, 331, 290, 291, 332, 290,
545
+ 291, 333, 290, 291, 334, 290, 291, 335,
546
+ 290, 291, 336, 290, 291, 337, 290, 291,
547
+ 338, 290, 291, 339, 290, 291, 340, 290,
548
+ 291, 341, 290, 291, 323, 290, 291, 343,
549
+ 290, 291, 344, 290, 291, 345, 290, 291,
550
+ 346, 290, 291, 347, 290, 291, 348, 290,
551
+ 291, 349, 290, 291, 350, 290, 291, 351,
552
+ 290, 291, 352, 290, 291, 353, 290, 291,
553
+ 354, 290, 291, 355, 290, 291, 356, 290,
554
+ 291, 357, 290, 291, 358, 290, 291, 359,
555
+ 290, 291, 360, 290, 291, 323, 290, 291,
556
+ 362, 290, 291, 363, 290, 291, 364, 290,
557
+ 291, 315, 290, 366, 0, 367, 0, 368,
558
+ 0, 45, 0, 369, 370, 369, 0, 374,
559
+ 373, 372, 370, 373, 371, 0, 372, 370,
560
+ 371, 0, 372, 371, 374, 373, 372, 370,
561
+ 373, 371, 374, 374, 5, 15, 17, 31,
562
+ 34, 37, 43, 46, 62, 64, 130, 135,
563
+ 212, 282, 365, 369, 374, 0, 0, 0
564
+ };
565
+
566
+ static const unsigned char _lexer_trans_actions[] = {
567
+ 0, 54, 0, 5, 1, 0, 29, 1,
568
+ 29, 29, 29, 29, 29, 29, 29, 29,
569
+ 29, 29, 35, 0, 43, 0, 43, 0,
570
+ 43, 54, 0, 5, 1, 0, 29, 1,
571
+ 29, 29, 29, 29, 29, 29, 29, 29,
572
+ 29, 29, 35, 0, 43, 0, 43, 0,
573
+ 43, 139, 48, 9, 106, 11, 0, 134,
574
+ 45, 45, 45, 3, 122, 33, 33, 33,
575
+ 0, 122, 33, 33, 33, 0, 122, 33,
576
+ 0, 33, 0, 102, 7, 7, 43, 54,
577
+ 0, 0, 43, 114, 25, 0, 54, 43,
578
+ 0, 43, 0, 43, 0, 43, 0, 43,
579
+ 0, 43, 0, 43, 0, 43, 0, 43,
580
+ 0, 43, 0, 43, 0, 43, 0, 43,
581
+ 0, 43, 0, 43, 0, 43, 149, 126,
582
+ 57, 110, 23, 0, 43, 43, 43, 43,
583
+ 0, 27, 118, 27, 27, 51, 27, 0,
584
+ 54, 0, 1, 0, 43, 0, 43, 0,
585
+ 43, 0, 43, 0, 43, 0, 43, 0,
586
+ 43, 0, 43, 0, 43, 0, 43, 0,
587
+ 43, 0, 43, 0, 43, 0, 43, 0,
588
+ 43, 0, 43, 144, 57, 54, 0, 54,
589
+ 0, 81, 84, 81, 0, 0, 54, 0,
590
+ 0, 54, 0, 0, 54, 0, 0, 54,
591
+ 0, 0, 54, 0, 0, 54, 21, 0,
592
+ 130, 31, 60, 57, 31, 63, 57, 63,
593
+ 63, 63, 63, 63, 63, 63, 63, 63,
594
+ 63, 66, 31, 43, 0, 43, 0, 43,
595
+ 0, 43, 0, 43, 0, 43, 0, 43,
596
+ 0, 43, 0, 43, 144, 57, 54, 0,
597
+ 54, 0, 69, 33, 69, 84, 84, 84,
598
+ 84, 84, 0, 0, 54, 0, 0, 54,
599
+ 0, 0, 54, 0, 0, 54, 0, 0,
600
+ 54, 0, 0, 54, 0, 0, 54, 0,
601
+ 0, 54, 0, 0, 54, 0, 0, 54,
602
+ 0, 0, 54, 0, 0, 54, 0, 0,
603
+ 54, 0, 0, 54, 13, 0, 54, 0,
604
+ 0, 54, 0, 0, 54, 0, 0, 54,
605
+ 0, 0, 54, 0, 0, 54, 13, 0,
606
+ 54, 0, 0, 54, 0, 0, 54, 0,
607
+ 0, 54, 0, 0, 54, 0, 0, 54,
608
+ 0, 0, 54, 0, 0, 54, 0, 0,
609
+ 54, 0, 0, 54, 0, 0, 54, 0,
610
+ 0, 54, 0, 0, 54, 0, 0, 54,
611
+ 0, 0, 54, 0, 0, 54, 0, 0,
612
+ 54, 0, 0, 54, 0, 0, 54, 0,
613
+ 0, 54, 0, 0, 54, 0, 0, 54,
614
+ 0, 0, 54, 0, 0, 54, 0, 0,
615
+ 54, 0, 0, 54, 0, 0, 54, 0,
616
+ 0, 54, 0, 0, 54, 0, 0, 54,
617
+ 0, 0, 54, 0, 0, 54, 0, 0,
618
+ 54, 0, 0, 54, 0, 0, 54, 0,
619
+ 0, 54, 0, 0, 54, 0, 0, 0,
620
+ 43, 0, 43, 0, 43, 0, 43, 0,
621
+ 43, 0, 43, 0, 43, 0, 43, 0,
622
+ 43, 0, 43, 0, 43, 0, 43, 0,
623
+ 43, 0, 43, 0, 43, 0, 43, 0,
624
+ 43, 0, 43, 0, 43, 144, 57, 54,
625
+ 0, 54, 0, 72, 33, 84, 72, 84,
626
+ 84, 84, 84, 84, 84, 84, 84, 0,
627
+ 0, 54, 0, 0, 54, 0, 0, 54,
628
+ 0, 0, 54, 0, 0, 54, 0, 0,
629
+ 54, 0, 0, 54, 0, 0, 54, 0,
630
+ 0, 54, 0, 0, 54, 0, 0, 54,
631
+ 0, 0, 54, 0, 0, 54, 0, 0,
632
+ 54, 15, 0, 54, 15, 0, 54, 0,
633
+ 0, 54, 0, 0, 54, 0, 0, 54,
634
+ 0, 0, 54, 0, 0, 54, 0, 0,
635
+ 54, 0, 0, 54, 0, 0, 54, 0,
636
+ 0, 54, 0, 0, 54, 0, 0, 54,
637
+ 0, 0, 54, 0, 0, 54, 0, 0,
638
+ 54, 0, 0, 54, 0, 0, 54, 15,
639
+ 0, 54, 0, 0, 54, 0, 0, 54,
640
+ 0, 0, 54, 0, 0, 54, 0, 0,
641
+ 54, 0, 0, 54, 0, 0, 54, 0,
642
+ 0, 54, 0, 0, 54, 0, 0, 54,
643
+ 0, 0, 54, 0, 0, 54, 0, 0,
644
+ 54, 0, 0, 54, 0, 0, 54, 0,
645
+ 0, 54, 0, 0, 54, 0, 0, 54,
646
+ 0, 0, 54, 0, 0, 54, 0, 0,
647
+ 54, 0, 0, 54, 0, 0, 54, 0,
648
+ 0, 54, 0, 0, 54, 0, 0, 54,
649
+ 0, 0, 54, 0, 0, 0, 43, 0,
650
+ 43, 0, 43, 0, 43, 0, 43, 0,
651
+ 43, 0, 43, 0, 43, 0, 43, 0,
652
+ 43, 0, 43, 0, 43, 0, 43, 0,
653
+ 43, 0, 43, 0, 43, 0, 43, 0,
654
+ 43, 0, 43, 0, 43, 144, 57, 54,
655
+ 0, 54, 0, 78, 33, 84, 78, 84,
656
+ 84, 84, 84, 84, 84, 84, 0, 0,
657
+ 54, 0, 0, 54, 0, 0, 54, 0,
658
+ 0, 54, 0, 0, 54, 0, 0, 54,
659
+ 0, 0, 54, 0, 0, 54, 0, 0,
660
+ 54, 0, 0, 54, 0, 0, 54, 0,
661
+ 0, 54, 0, 0, 54, 0, 0, 54,
662
+ 19, 0, 54, 19, 0, 54, 0, 0,
663
+ 54, 0, 0, 54, 0, 0, 54, 0,
664
+ 0, 54, 0, 0, 54, 0, 0, 54,
665
+ 0, 0, 54, 0, 0, 54, 0, 0,
666
+ 54, 0, 0, 54, 0, 0, 54, 0,
667
+ 0, 54, 0, 0, 54, 0, 0, 54,
668
+ 0, 0, 54, 0, 0, 54, 19, 0,
669
+ 54, 0, 0, 54, 0, 0, 54, 0,
670
+ 0, 54, 0, 0, 54, 0, 0, 54,
671
+ 0, 0, 54, 0, 0, 54, 0, 0,
672
+ 54, 0, 0, 54, 0, 0, 54, 0,
673
+ 0, 54, 0, 0, 54, 0, 0, 54,
674
+ 0, 0, 54, 0, 0, 0, 43, 0,
675
+ 43, 0, 43, 0, 43, 0, 43, 0,
676
+ 43, 0, 43, 144, 57, 54, 0, 54,
677
+ 0, 75, 33, 84, 75, 84, 84, 84,
678
+ 84, 84, 84, 84, 84, 84, 0, 0,
679
+ 54, 0, 0, 54, 0, 0, 54, 0,
680
+ 0, 54, 0, 0, 54, 0, 0, 54,
681
+ 0, 0, 54, 0, 0, 54, 0, 0,
682
+ 54, 0, 0, 54, 0, 0, 54, 0,
683
+ 0, 54, 0, 0, 54, 0, 0, 54,
684
+ 17, 0, 54, 17, 0, 54, 0, 0,
685
+ 54, 0, 0, 54, 0, 0, 54, 0,
686
+ 0, 54, 0, 0, 54, 0, 0, 54,
687
+ 0, 0, 54, 0, 0, 54, 0, 0,
688
+ 54, 0, 0, 54, 0, 0, 54, 0,
689
+ 0, 54, 0, 0, 54, 0, 0, 54,
690
+ 0, 0, 54, 0, 0, 54, 17, 0,
691
+ 54, 0, 0, 54, 0, 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, 54, 0, 0, 54, 0, 0,
703
+ 54, 0, 0, 54, 0, 0, 54, 0,
704
+ 0, 54, 0, 0, 54, 0, 0, 54,
705
+ 0, 0, 54, 0, 0, 54, 0, 0,
706
+ 54, 0, 0, 0, 43, 0, 43, 0,
707
+ 43, 0, 43, 0, 0, 0, 43, 54,
708
+ 37, 37, 87, 37, 37, 43, 0, 39,
709
+ 0, 43, 0, 0, 54, 0, 0, 39,
710
+ 0, 0, 54, 0, 93, 90, 41, 96,
711
+ 90, 96, 96, 96, 96, 96, 96, 96,
712
+ 96, 96, 96, 99, 0, 43, 0, 0
713
+ };
714
+
715
+ static const unsigned char _lexer_eof_actions[] = {
716
+ 0, 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
+ 43, 43, 43, 43, 43, 43, 43, 43,
753
+ 43, 43, 43, 43, 43, 43, 43, 43,
754
+ 43, 43, 43, 43, 43, 43, 43, 43,
755
+ 43, 43, 43, 43, 43, 43, 43, 43,
756
+ 43, 43, 43, 43, 43, 43, 43, 43,
757
+ 43, 43, 43, 43, 43, 43, 43, 43,
758
+ 43, 43, 43, 43, 43, 43, 43, 43,
759
+ 43, 43, 43, 43, 43, 43, 43, 43,
760
+ 43, 43, 43, 43, 43, 43, 43, 43,
761
+ 43, 43, 43, 43, 43, 43, 43, 43,
762
+ 43, 43, 43, 43, 43, 43, 43, 43
763
+ };
764
+
765
+ static const int lexer_start = 1;
766
+ static const int lexer_first_final = 375;
767
+ static const int lexer_error = 0;
768
+
769
+ static const int lexer_en_main = 1;
770
+
771
+
772
+ #line 258 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
773
+
774
+ static VALUE
775
+ unindent(VALUE con, int start_col)
776
+ {
777
+ VALUE re;
778
+ // Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters
779
+ char pat[32];
780
+ snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
781
+ re = rb_reg_regcomp(rb_str_new2(pat));
782
+ rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2(""));
783
+
784
+ return Qnil;
785
+
786
+ }
787
+
788
+ static void
789
+ store_kw_con(VALUE listener, const char * event_name,
790
+ const char * keyword_at, size_t keyword_length,
791
+ const char * at, size_t length,
792
+ int current_line)
793
+ {
794
+ VALUE con = Qnil, kw = Qnil;
795
+ kw = ENCODED_STR_NEW(keyword_at, keyword_length);
796
+ con = ENCODED_STR_NEW(at, length);
797
+ rb_funcall(con, rb_intern("strip!"), 0);
798
+ rb_funcall(listener, rb_intern(event_name), 3, kw, con, INT2FIX(current_line));
799
+ }
800
+
801
+ static void
802
+ store_multiline_kw_con(VALUE listener, const char * event_name,
803
+ const char * keyword_at, size_t keyword_length,
804
+ const char * at, size_t length,
805
+ int current_line, int start_col)
806
+ {
807
+ VALUE split;
808
+ VALUE con = Qnil, kw = Qnil, name = Qnil, desc = Qnil;
809
+
810
+ kw = ENCODED_STR_NEW(keyword_at, keyword_length);
811
+ con = ENCODED_STR_NEW(at, length);
812
+
813
+ unindent(con, start_col);
814
+
815
+ split = rb_str_split(con, "\n");
816
+
817
+ name = rb_funcall(split, rb_intern("shift"), 0);
818
+ desc = rb_ary_join(split, rb_str_new2( "\n" ));
819
+
820
+ if( name == Qnil )
821
+ {
822
+ name = rb_str_new2("");
823
+ }
824
+ if( rb_funcall(desc, rb_intern("size"), 0) == 0)
825
+ {
826
+ desc = rb_str_new2("");
827
+ }
828
+ rb_funcall(name, rb_intern("strip!"), 0);
829
+ rb_funcall(desc, rb_intern("rstrip!"), 0);
830
+ rb_funcall(listener, rb_intern(event_name), 4, kw, name, desc, INT2FIX(current_line));
831
+ }
832
+
833
+ static void
834
+ store_attr(VALUE listener, const char * attr_type,
835
+ const char * at, size_t length,
836
+ int line)
837
+ {
838
+ VALUE val = ENCODED_STR_NEW(at, length);
839
+ rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line));
840
+ }
841
+ static void
842
+ store_docstring_content(VALUE listener,
843
+ int start_col,
844
+ const char *type_at, size_t type_length,
845
+ const char *at, size_t length,
846
+ int current_line)
847
+ {
848
+ VALUE re2;
849
+ VALUE unescape_escaped_quotes;
850
+ VALUE con = ENCODED_STR_NEW(at, length);
851
+ VALUE con_type = ENCODED_STR_NEW(type_at, type_length);
852
+
853
+ unindent(con, start_col);
854
+
855
+ re2 = rb_reg_regcomp(rb_str_new2("\r\\Z"));
856
+ unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\""));
857
+ rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
858
+ rb_funcall(con_type, rb_intern("strip!"), 0);
859
+ rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\""));
860
+ rb_funcall(listener, rb_intern("doc_string"), 3, con_type, con, INT2FIX(current_line));
861
+ }
862
+ static void
863
+ raise_lexer_error(const char * at, int line)
864
+ {
865
+ rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.", line, at);
866
+ }
867
+
868
+ static void lexer_init(lexer_state *lexer) {
869
+ lexer->content_start = 0;
870
+ lexer->content_end = 0;
871
+ lexer->content_len = 0;
872
+ lexer->docstring_content_type_start = 0;
873
+ lexer->docstring_content_type_end = 0;
874
+ lexer->mark = 0;
875
+ lexer->keyword_start = 0;
876
+ lexer->keyword_end = 0;
877
+ lexer->next_keyword_start = 0;
878
+ lexer->line_number = 1;
879
+ lexer->last_newline = 0;
880
+ lexer->final_newline = 0;
881
+ lexer->start_col = 0;
882
+ }
883
+
884
+ static VALUE CLexer_alloc(VALUE klass)
885
+ {
886
+ VALUE obj;
887
+ lexer_state *lxr = ALLOC(lexer_state);
888
+ lexer_init(lxr);
889
+
890
+ obj = Data_Wrap_Struct(klass, NULL, -1, lxr);
891
+
892
+ return obj;
893
+ }
894
+
895
+ static VALUE CLexer_init(VALUE self, VALUE listener)
896
+ {
897
+ lexer_state *lxr;
898
+ rb_iv_set(self, "@listener", listener);
899
+
900
+ lxr = NULL;
901
+ DATA_GET(self, lexer_state, lxr);
902
+ lexer_init(lxr);
903
+
904
+ return self;
905
+ }
906
+
907
+ static VALUE CLexer_scan(VALUE self, VALUE input)
908
+ {
909
+ VALUE input_copy;
910
+ char *data;
911
+ size_t len;
912
+ VALUE listener = rb_iv_get(self, "@listener");
913
+
914
+ lexer_state *lexer;
915
+ lexer = NULL;
916
+ DATA_GET(self, lexer_state, lexer);
917
+
918
+ input_copy = rb_str_dup(input);
919
+
920
+ rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%"));
921
+ data = RSTRING_PTR(input_copy);
922
+ len = RSTRING_LEN(input_copy);
923
+
924
+ if (len == 0) {
925
+ rb_raise(rb_eGherkinLexingError, "No content to lex.");
926
+ } else {
927
+
928
+ const char *p, *pe, *eof;
929
+ int cs = 0;
930
+
931
+ VALUE current_row = Qnil;
932
+
933
+ p = data;
934
+ pe = data + len;
935
+ eof = pe;
936
+
937
+ assert(*pe == '\0' && "pointer does not end on NULL");
938
+
939
+
940
+ #line 941 "ext/gherkin_lexer_bm/gherkin_lexer_bm.c"
941
+ {
942
+ cs = lexer_start;
943
+ }
944
+
945
+ #line 425 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
946
+
947
+ #line 948 "ext/gherkin_lexer_bm/gherkin_lexer_bm.c"
948
+ {
949
+ int _klen;
950
+ unsigned int _trans;
951
+ const char *_acts;
952
+ unsigned int _nacts;
953
+ const char *_keys;
954
+
955
+ if ( p == pe )
956
+ goto _test_eof;
957
+ if ( cs == 0 )
958
+ goto _out;
959
+ _resume:
960
+ _keys = _lexer_trans_keys + _lexer_key_offsets[cs];
961
+ _trans = _lexer_index_offsets[cs];
962
+
963
+ _klen = _lexer_single_lengths[cs];
964
+ if ( _klen > 0 ) {
965
+ const char *_lower = _keys;
966
+ const char *_mid;
967
+ const char *_upper = _keys + _klen - 1;
968
+ while (1) {
969
+ if ( _upper < _lower )
970
+ break;
971
+
972
+ _mid = _lower + ((_upper-_lower) >> 1);
973
+ if ( (*p) < *_mid )
974
+ _upper = _mid - 1;
975
+ else if ( (*p) > *_mid )
976
+ _lower = _mid + 1;
977
+ else {
978
+ _trans += (_mid - _keys);
979
+ goto _match;
980
+ }
981
+ }
982
+ _keys += _klen;
983
+ _trans += _klen;
984
+ }
985
+
986
+ _klen = _lexer_range_lengths[cs];
987
+ if ( _klen > 0 ) {
988
+ const char *_lower = _keys;
989
+ const char *_mid;
990
+ const char *_upper = _keys + (_klen<<1) - 2;
991
+ while (1) {
992
+ if ( _upper < _lower )
993
+ break;
994
+
995
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
996
+ if ( (*p) < _mid[0] )
997
+ _upper = _mid - 2;
998
+ else if ( (*p) > _mid[1] )
999
+ _lower = _mid + 2;
1000
+ else {
1001
+ _trans += ((_mid - _keys)>>1);
1002
+ goto _match;
1003
+ }
1004
+ }
1005
+ _trans += _klen;
1006
+ }
1007
+
1008
+ _match:
1009
+ cs = _lexer_trans_targs[_trans];
1010
+
1011
+ if ( _lexer_trans_actions[_trans] == 0 )
1012
+ goto _again;
1013
+
1014
+ _acts = _lexer_actions + _lexer_trans_actions[_trans];
1015
+ _nacts = (unsigned int) *_acts++;
1016
+ while ( _nacts-- > 0 )
1017
+ {
1018
+ switch ( *_acts++ )
1019
+ {
1020
+ case 0:
1021
+ #line 83 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1022
+ {
1023
+ MARK(content_start, p);
1024
+ lexer->current_line = lexer->line_number;
1025
+ lexer->start_col = lexer->content_start - lexer->last_newline - (lexer->keyword_end - lexer->keyword_start) + 2;
1026
+ }
1027
+ break;
1028
+ case 1:
1029
+ #line 89 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1030
+ {
1031
+ MARK(content_start, p);
1032
+ }
1033
+ break;
1034
+ case 2:
1035
+ #line 93 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1036
+ {
1037
+ lexer->current_line = lexer->line_number;
1038
+ lexer->start_col = p - data - lexer->last_newline;
1039
+ }
1040
+ break;
1041
+ case 3:
1042
+ #line 98 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1043
+ {
1044
+ int len = LEN(content_start, PTR_TO(final_newline));
1045
+ int type_len = LEN(docstring_content_type_start, PTR_TO(docstring_content_type_end));
1046
+
1047
+ if (len < 0) len = 0;
1048
+ if (type_len < 0) len = 0;
1049
+
1050
+ store_docstring_content(listener, lexer->start_col, PTR_TO(docstring_content_type_start), type_len, PTR_TO(content_start), len, lexer->current_line);
1051
+ }
1052
+ break;
1053
+ case 4:
1054
+ #line 108 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1055
+ {
1056
+ MARK(docstring_content_type_start, p);
1057
+ }
1058
+ break;
1059
+ case 5:
1060
+ #line 112 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1061
+ {
1062
+ MARK(docstring_content_type_end, p);
1063
+ }
1064
+ break;
1065
+ case 6:
1066
+ #line 116 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1067
+ {
1068
+ STORE_KW_END_CON(feature);
1069
+ }
1070
+ break;
1071
+ case 7:
1072
+ #line 120 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1073
+ {
1074
+ STORE_KW_END_CON(background);
1075
+ }
1076
+ break;
1077
+ case 8:
1078
+ #line 124 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1079
+ {
1080
+ STORE_KW_END_CON(scenario);
1081
+ }
1082
+ break;
1083
+ case 9:
1084
+ #line 128 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1085
+ {
1086
+ STORE_KW_END_CON(scenario_outline);
1087
+ }
1088
+ break;
1089
+ case 10:
1090
+ #line 132 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1091
+ {
1092
+ STORE_KW_END_CON(examples);
1093
+ }
1094
+ break;
1095
+ case 11:
1096
+ #line 136 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1097
+ {
1098
+ store_kw_con(listener, "step",
1099
+ PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end)),
1100
+ PTR_TO(content_start), LEN(content_start, p),
1101
+ lexer->current_line);
1102
+ }
1103
+ break;
1104
+ case 12:
1105
+ #line 143 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1106
+ {
1107
+ STORE_ATTR(comment);
1108
+ lexer->mark = 0;
1109
+ }
1110
+ break;
1111
+ case 13:
1112
+ #line 148 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1113
+ {
1114
+ STORE_ATTR(tag);
1115
+ lexer->mark = 0;
1116
+ }
1117
+ break;
1118
+ case 14:
1119
+ #line 153 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1120
+ {
1121
+ lexer->line_number += 1;
1122
+ MARK(final_newline, p);
1123
+ }
1124
+ break;
1125
+ case 15:
1126
+ #line 158 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1127
+ {
1128
+ MARK(last_newline, p + 1);
1129
+ }
1130
+ break;
1131
+ case 16:
1132
+ #line 162 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1133
+ {
1134
+ if (lexer->mark == 0) {
1135
+ MARK(mark, p);
1136
+ }
1137
+ }
1138
+ break;
1139
+ case 17:
1140
+ #line 168 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1141
+ {
1142
+ MARK(keyword_end, p);
1143
+ MARK(keyword_start, PTR_TO(mark));
1144
+ MARK(content_start, p + 1);
1145
+ lexer->mark = 0;
1146
+ }
1147
+ break;
1148
+ case 18:
1149
+ #line 175 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1150
+ {
1151
+ MARK(content_end, p);
1152
+ }
1153
+ break;
1154
+ case 19:
1155
+ #line 179 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1156
+ {
1157
+ p = p - 1;
1158
+ lexer->current_line = lexer->line_number;
1159
+ current_row = rb_ary_new();
1160
+ }
1161
+ break;
1162
+ case 20:
1163
+ #line 185 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1164
+ {
1165
+ MARK(content_start, p);
1166
+ }
1167
+ break;
1168
+ case 21:
1169
+ #line 189 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1170
+ {
1171
+ VALUE re_pipe, re_newline, re_backslash;
1172
+ VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p));
1173
+ rb_funcall(con, rb_intern("strip!"), 0);
1174
+ re_pipe = rb_reg_regcomp(rb_str_new2("\\\\\\|"));
1175
+ re_newline = rb_reg_regcomp(rb_str_new2("\\\\n"));
1176
+ re_backslash = rb_reg_regcomp(rb_str_new2("\\\\\\\\"));
1177
+ rb_funcall(con, rb_intern("gsub!"), 2, re_pipe, rb_str_new2("|"));
1178
+ rb_funcall(con, rb_intern("gsub!"), 2, re_newline, rb_str_new2("\n"));
1179
+ rb_funcall(con, rb_intern("gsub!"), 2, re_backslash, rb_str_new2("\\"));
1180
+
1181
+ rb_ary_push(current_row, con);
1182
+ }
1183
+ break;
1184
+ case 22:
1185
+ #line 203 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1186
+ {
1187
+ rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line));
1188
+ }
1189
+ break;
1190
+ case 23:
1191
+ #line 207 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1192
+ {
1193
+ int line;
1194
+ if (cs < lexer_first_final) {
1195
+ size_t count = 0;
1196
+ VALUE newstr_val;
1197
+ char *newstr;
1198
+ int newstr_count = 0;
1199
+ size_t len;
1200
+ const char *buff;
1201
+ if (lexer->last_newline != 0) {
1202
+ len = LEN(last_newline, eof);
1203
+ buff = PTR_TO(last_newline);
1204
+ } else {
1205
+ len = strlen(data);
1206
+ buff = data;
1207
+ }
1208
+
1209
+ // Allocate as a ruby string so that it gets cleaned up by GC
1210
+ newstr_val = rb_str_new(buff, len);
1211
+ newstr = RSTRING_PTR(newstr_val);
1212
+
1213
+
1214
+ for (count = 0; count < len; count++) {
1215
+ if(buff[count] == 10) {
1216
+ newstr[newstr_count] = '\0'; // terminate new string at first newline found
1217
+ break;
1218
+ } else {
1219
+ if (buff[count] == '%') {
1220
+ newstr[newstr_count++] = buff[count];
1221
+ newstr[newstr_count] = buff[count];
1222
+ } else {
1223
+ newstr[newstr_count] = buff[count];
1224
+ }
1225
+ }
1226
+ newstr_count++;
1227
+ }
1228
+
1229
+ line = lexer->line_number;
1230
+ lexer_init(lexer); // Re-initialize so we can scan again with the same lexer
1231
+ raise_lexer_error(newstr, line);
1232
+ } else {
1233
+ rb_funcall(listener, rb_intern("eof"), 0);
1234
+ }
1235
+ }
1236
+ break;
1237
+ #line 1238 "ext/gherkin_lexer_bm/gherkin_lexer_bm.c"
1238
+ }
1239
+ }
1240
+
1241
+ _again:
1242
+ if ( cs == 0 )
1243
+ goto _out;
1244
+ if ( ++p != pe )
1245
+ goto _resume;
1246
+ _test_eof: {}
1247
+ if ( p == eof )
1248
+ {
1249
+ const char *__acts = _lexer_actions + _lexer_eof_actions[cs];
1250
+ unsigned int __nacts = (unsigned int) *__acts++;
1251
+ while ( __nacts-- > 0 ) {
1252
+ switch ( *__acts++ ) {
1253
+ case 23:
1254
+ #line 207 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1255
+ {
1256
+ int line;
1257
+ if (cs < lexer_first_final) {
1258
+ size_t count = 0;
1259
+ VALUE newstr_val;
1260
+ char *newstr;
1261
+ int newstr_count = 0;
1262
+ size_t len;
1263
+ const char *buff;
1264
+ if (lexer->last_newline != 0) {
1265
+ len = LEN(last_newline, eof);
1266
+ buff = PTR_TO(last_newline);
1267
+ } else {
1268
+ len = strlen(data);
1269
+ buff = data;
1270
+ }
1271
+
1272
+ // Allocate as a ruby string so that it gets cleaned up by GC
1273
+ newstr_val = rb_str_new(buff, len);
1274
+ newstr = RSTRING_PTR(newstr_val);
1275
+
1276
+
1277
+ for (count = 0; count < len; count++) {
1278
+ if(buff[count] == 10) {
1279
+ newstr[newstr_count] = '\0'; // terminate new string at first newline found
1280
+ break;
1281
+ } else {
1282
+ if (buff[count] == '%') {
1283
+ newstr[newstr_count++] = buff[count];
1284
+ newstr[newstr_count] = buff[count];
1285
+ } else {
1286
+ newstr[newstr_count] = buff[count];
1287
+ }
1288
+ }
1289
+ newstr_count++;
1290
+ }
1291
+
1292
+ line = lexer->line_number;
1293
+ lexer_init(lexer); // Re-initialize so we can scan again with the same lexer
1294
+ raise_lexer_error(newstr, line);
1295
+ } else {
1296
+ rb_funcall(listener, rb_intern("eof"), 0);
1297
+ }
1298
+ }
1299
+ break;
1300
+ #line 1301 "ext/gherkin_lexer_bm/gherkin_lexer_bm.c"
1301
+ }
1302
+ }
1303
+ }
1304
+
1305
+ _out: {}
1306
+ }
1307
+
1308
+ #line 426 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/bm.c.rl"
1309
+
1310
+ assert(p <= pe && "data overflow after parsing execute");
1311
+ assert(lexer->content_start <= len && "content starts after data end");
1312
+ assert(lexer->mark < len && "mark is after data end");
1313
+
1314
+ // Reset lexer by re-initializing the whole thing
1315
+ lexer_init(lexer);
1316
+
1317
+ if (cs == lexer_error) {
1318
+ rb_raise(rb_eGherkinLexingError, "Invalid format, lexing fails.");
1319
+ } else {
1320
+ return Qtrue;
1321
+ }
1322
+ }
1323
+ }
1324
+
1325
+ void Init_gherkin_lexer_bm()
1326
+ {
1327
+ mGherkin = rb_define_module("Gherkin");
1328
+ mGherkinLexer = rb_define_module_under(mGherkin, "Lexer");
1329
+ rb_eGherkinLexingError = rb_const_get(mGherkinLexer, rb_intern("LexingError"));
1330
+
1331
+ mCLexer = rb_define_module_under(mGherkin, "CLexer");
1332
+ cI18nLexer = rb_define_class_under(mCLexer, "Bm", rb_cObject);
1333
+ rb_define_alloc_func(cI18nLexer, CLexer_alloc);
1334
+ rb_define_method(cI18nLexer, "initialize", CLexer_init, 1);
1335
+ rb_define_method(cI18nLexer, "scan", CLexer_scan, 1);
1336
+ }
1337
+