benhamill-gherkin 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.gitattributes +2 -0
  2. data/.gitignore +11 -0
  3. data/.mailmap +2 -0
  4. data/.rspec +1 -0
  5. data/.rvmrc +1 -0
  6. data/Gemfile +7 -0
  7. data/History.txt +363 -0
  8. data/LICENSE +20 -0
  9. data/README.rdoc +149 -0
  10. data/Rakefile +19 -0
  11. data/VERSION +1 -0
  12. data/build_native_gems.sh +8 -0
  13. data/cucumber.yml +3 -0
  14. data/features/escaped_pipes.feature +8 -0
  15. data/features/feature_parser.feature +237 -0
  16. data/features/json_formatter.feature +377 -0
  17. data/features/json_parser.feature +318 -0
  18. data/features/native_lexer.feature +19 -0
  19. data/features/parser_with_native_lexer.feature +205 -0
  20. data/features/pretty_formatter.feature +15 -0
  21. data/features/step_definitions/eyeball_steps.rb +3 -0
  22. data/features/step_definitions/gherkin_steps.rb +29 -0
  23. data/features/step_definitions/json_formatter_steps.rb +28 -0
  24. data/features/step_definitions/json_parser_steps.rb +20 -0
  25. data/features/step_definitions/pretty_formatter_steps.rb +84 -0
  26. data/features/steps_parser.feature +46 -0
  27. data/features/support/env.rb +38 -0
  28. data/gherkin.gemspec +61 -0
  29. data/ikvm/.gitignore +3 -0
  30. data/java/.gitignore +5 -0
  31. data/java/src/main/java/gherkin/lexer/i18n/.gitignore +1 -0
  32. data/java/src/main/resources/gherkin/.gitignore +1 -0
  33. data/js/lib/gherkin/lexer/i18n/ar.js +1094 -0
  34. data/js/lib/gherkin/lexer/i18n/bg.js +1308 -0
  35. data/js/lib/gherkin/lexer/i18n/ca.js +1236 -0
  36. data/js/lib/gherkin/lexer/i18n/cs.js +1090 -0
  37. data/js/lib/gherkin/lexer/i18n/cy_gb.js +958 -0
  38. data/js/lib/gherkin/lexer/i18n/da.js +974 -0
  39. data/js/lib/gherkin/lexer/i18n/de.js +1082 -0
  40. data/js/lib/gherkin/lexer/i18n/en.js +965 -0
  41. data/js/lib/gherkin/lexer/i18n/en_au.js +902 -0
  42. data/js/lib/gherkin/lexer/i18n/en_lol.js +859 -0
  43. data/js/lib/gherkin/lexer/i18n/en_pirate.js +1136 -0
  44. data/js/lib/gherkin/lexer/i18n/en_scouse.js +1289 -0
  45. data/js/lib/gherkin/lexer/i18n/en_tx.js +942 -0
  46. data/js/lib/gherkin/lexer/i18n/eo.js +916 -0
  47. data/js/lib/gherkin/lexer/i18n/es.js +1049 -0
  48. data/js/lib/gherkin/lexer/i18n/et.js +915 -0
  49. data/js/lib/gherkin/lexer/i18n/fi.js +894 -0
  50. data/js/lib/gherkin/lexer/i18n/fr.js +1116 -0
  51. data/js/lib/gherkin/lexer/i18n/he.js +1044 -0
  52. data/js/lib/gherkin/lexer/i18n/hr.js +994 -0
  53. data/js/lib/gherkin/lexer/i18n/hu.js +1043 -0
  54. data/js/lib/gherkin/lexer/i18n/id.js +884 -0
  55. data/js/lib/gherkin/lexer/i18n/it.js +1007 -0
  56. data/js/lib/gherkin/lexer/i18n/ja.js +1344 -0
  57. data/js/lib/gherkin/lexer/i18n/ko.js +1028 -0
  58. data/js/lib/gherkin/lexer/i18n/lt.js +972 -0
  59. data/js/lib/gherkin/lexer/i18n/lu.js +1057 -0
  60. data/js/lib/gherkin/lexer/i18n/lv.js +1092 -0
  61. data/js/lib/gherkin/lexer/i18n/nl.js +1036 -0
  62. data/js/lib/gherkin/lexer/i18n/no.js +986 -0
  63. data/js/lib/gherkin/lexer/i18n/pl.js +1140 -0
  64. data/js/lib/gherkin/lexer/i18n/pt.js +1000 -0
  65. data/js/lib/gherkin/lexer/i18n/ro.js +1089 -0
  66. data/js/lib/gherkin/lexer/i18n/ru.js +1560 -0
  67. data/js/lib/gherkin/lexer/i18n/sk.js +972 -0
  68. data/js/lib/gherkin/lexer/i18n/sr_cyrl.js +1728 -0
  69. data/js/lib/gherkin/lexer/i18n/sr_latn.js +1220 -0
  70. data/js/lib/gherkin/lexer/i18n/sv.js +997 -0
  71. data/js/lib/gherkin/lexer/i18n/tr.js +1014 -0
  72. data/js/lib/gherkin/lexer/i18n/uk.js +1572 -0
  73. data/js/lib/gherkin/lexer/i18n/uz.js +1302 -0
  74. data/js/lib/gherkin/lexer/i18n/vi.js +1124 -0
  75. data/js/lib/gherkin/lexer/i18n/zh_cn.js +902 -0
  76. data/js/lib/gherkin/lexer/i18n/zh_tw.js +940 -0
  77. data/lib/.gitignore +4 -0
  78. data/lib/gherkin.rb +2 -0
  79. data/lib/gherkin/c_lexer.rb +17 -0
  80. data/lib/gherkin/formatter/ansi_escapes.rb +95 -0
  81. data/lib/gherkin/formatter/argument.rb +16 -0
  82. data/lib/gherkin/formatter/escaping.rb +15 -0
  83. data/lib/gherkin/formatter/filter_formatter.rb +136 -0
  84. data/lib/gherkin/formatter/hashable.rb +19 -0
  85. data/lib/gherkin/formatter/json_formatter.rb +102 -0
  86. data/lib/gherkin/formatter/line_filter.rb +26 -0
  87. data/lib/gherkin/formatter/model.rb +236 -0
  88. data/lib/gherkin/formatter/pretty_formatter.rb +243 -0
  89. data/lib/gherkin/formatter/regexp_filter.rb +21 -0
  90. data/lib/gherkin/formatter/step_printer.rb +17 -0
  91. data/lib/gherkin/formatter/tag_count_formatter.rb +47 -0
  92. data/lib/gherkin/formatter/tag_filter.rb +19 -0
  93. data/lib/gherkin/i18n.rb +175 -0
  94. data/lib/gherkin/i18n.yml +588 -0
  95. data/lib/gherkin/json_parser.rb +137 -0
  96. data/lib/gherkin/lexer/i18n_lexer.rb +47 -0
  97. data/lib/gherkin/listener/event.rb +45 -0
  98. data/lib/gherkin/listener/formatter_listener.rb +113 -0
  99. data/lib/gherkin/native.rb +7 -0
  100. data/lib/gherkin/native/ikvm.rb +55 -0
  101. data/lib/gherkin/native/java.rb +55 -0
  102. data/lib/gherkin/native/null.rb +9 -0
  103. data/lib/gherkin/parser/meta.txt +5 -0
  104. data/lib/gherkin/parser/parser.rb +164 -0
  105. data/lib/gherkin/parser/root.txt +11 -0
  106. data/lib/gherkin/parser/steps.txt +4 -0
  107. data/lib/gherkin/rb_lexer.rb +8 -0
  108. data/lib/gherkin/rb_lexer/.gitignore +1 -0
  109. data/lib/gherkin/rb_lexer/README.rdoc +8 -0
  110. data/lib/gherkin/rubify.rb +24 -0
  111. data/lib/gherkin/tag_expression.rb +62 -0
  112. data/lib/gherkin/version.rb +3 -0
  113. data/ragel/i18n/.gitignore +1 -0
  114. data/ragel/lexer.c.rl.erb +439 -0
  115. data/ragel/lexer.java.rl.erb +208 -0
  116. data/ragel/lexer.rb.rl.erb +167 -0
  117. data/ragel/lexer_common.rl.erb +50 -0
  118. data/spec/gherkin/c_lexer_spec.rb +21 -0
  119. data/spec/gherkin/fixtures/1.feature +8 -0
  120. data/spec/gherkin/fixtures/comments_in_table.feature +9 -0
  121. data/spec/gherkin/fixtures/complex.feature +45 -0
  122. data/spec/gherkin/fixtures/complex.json +143 -0
  123. data/spec/gherkin/fixtures/complex_for_filtering.feature +60 -0
  124. data/spec/gherkin/fixtures/complex_with_tags.feature +61 -0
  125. data/spec/gherkin/fixtures/dos_line_endings.feature +45 -0
  126. data/spec/gherkin/fixtures/hantu_pisang.feature +35 -0
  127. data/spec/gherkin/fixtures/i18n_fr.feature +14 -0
  128. data/spec/gherkin/fixtures/i18n_no.feature +7 -0
  129. data/spec/gherkin/fixtures/i18n_zh-CN.feature +9 -0
  130. data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +13 -0
  131. data/spec/gherkin/fixtures/scenario_without_steps.feature +5 -0
  132. data/spec/gherkin/fixtures/simple_with_comments.feature +7 -0
  133. data/spec/gherkin/fixtures/simple_with_tags.feature +11 -0
  134. data/spec/gherkin/fixtures/with_bom.feature +3 -0
  135. data/spec/gherkin/formatter/ansi_escapes_spec.rb +19 -0
  136. data/spec/gherkin/formatter/filter_formatter_spec.rb +165 -0
  137. data/spec/gherkin/formatter/model_spec.rb +28 -0
  138. data/spec/gherkin/formatter/pretty_formatter_spec.rb +158 -0
  139. data/spec/gherkin/formatter/spaces.feature +9 -0
  140. data/spec/gherkin/formatter/step_printer_spec.rb +55 -0
  141. data/spec/gherkin/formatter/tabs.feature +9 -0
  142. data/spec/gherkin/formatter/tag_count_formatter_spec.rb +30 -0
  143. data/spec/gherkin/i18n_spec.rb +152 -0
  144. data/spec/gherkin/java_lexer_spec.rb +20 -0
  145. data/spec/gherkin/java_libs.rb +20 -0
  146. data/spec/gherkin/json_parser_spec.rb +113 -0
  147. data/spec/gherkin/lexer/i18n_lexer_spec.rb +43 -0
  148. data/spec/gherkin/output_stream_string_io.rb +20 -0
  149. data/spec/gherkin/parser/parser_spec.rb +16 -0
  150. data/spec/gherkin/rb_lexer_spec.rb +19 -0
  151. data/spec/gherkin/sexp_recorder.rb +56 -0
  152. data/spec/gherkin/shared/lexer_group.rb +593 -0
  153. data/spec/gherkin/shared/py_string_group.rb +153 -0
  154. data/spec/gherkin/shared/row_group.rb +125 -0
  155. data/spec/gherkin/shared/tags_group.rb +54 -0
  156. data/spec/gherkin/tag_expression_spec.rb +137 -0
  157. data/spec/spec_helper.rb +69 -0
  158. data/tasks/bench.rake +184 -0
  159. data/tasks/bench/feature_builder.rb +49 -0
  160. data/tasks/bench/generated/.gitignore +1 -0
  161. data/tasks/bench/null_listener.rb +4 -0
  162. data/tasks/compile.rake +102 -0
  163. data/tasks/cucumber.rake +20 -0
  164. data/tasks/gems.rake +35 -0
  165. data/tasks/ikvm.rake +79 -0
  166. data/tasks/ragel_task.rb +70 -0
  167. data/tasks/rdoc.rake +9 -0
  168. data/tasks/release.rake +30 -0
  169. data/tasks/rspec.rake +8 -0
  170. metadata +609 -0
@@ -0,0 +1,902 @@
1
+
2
+ /* line 1 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
3
+ ;(function() {
4
+
5
+
6
+ /* line 107 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
7
+
8
+
9
+
10
+ /* line 11 "js/lib/gherkin/lexer/i18n/zh_cn.js" */
11
+ const _lexer_actions = [
12
+ 0, 1, 0, 1, 1, 1, 2, 1,
13
+ 3, 1, 4, 1, 5, 1, 6, 1,
14
+ 7, 1, 8, 1, 9, 1, 10, 1,
15
+ 11, 1, 14, 1, 15, 1, 16, 1,
16
+ 17, 1, 18, 1, 19, 1, 20, 1,
17
+ 21, 2, 2, 16, 2, 11, 0, 2,
18
+ 12, 13, 2, 15, 0, 2, 15, 1,
19
+ 2, 15, 14, 2, 15, 17, 2, 16,
20
+ 4, 2, 16, 5, 2, 16, 6, 2,
21
+ 16, 7, 2, 16, 8, 2, 16, 14,
22
+ 2, 18, 19, 2, 20, 0, 2, 20,
23
+ 1, 2, 20, 14, 2, 20, 17, 3,
24
+ 3, 12, 13, 3, 9, 12, 13, 3,
25
+ 10, 12, 13, 3, 11, 12, 13, 3,
26
+ 12, 13, 16, 3, 15, 12, 13, 4,
27
+ 2, 12, 13, 16, 4, 15, 0, 12,
28
+ 13
29
+ ];
30
+
31
+ const _lexer_key_offsets = [
32
+ 0, 0, 15, 17, 18, 19, 20, 21,
33
+ 22, 24, 38, 42, 43, 44, 45, 46,
34
+ 47, 48, 49, 50, 51, 52, 53, 63,
35
+ 65, 67, 69, 71, 73, 75, 89, 91,
36
+ 92, 93, 94, 95, 96, 97, 98, 99,
37
+ 100, 101, 102, 114, 116, 118, 120, 122,
38
+ 124, 129, 131, 133, 135, 137, 139, 141,
39
+ 143, 145, 147, 149, 151, 153, 155, 158,
40
+ 160, 162, 164, 166, 168, 170, 172, 174,
41
+ 176, 178, 180, 182, 184, 186, 188, 190,
42
+ 192, 194, 196, 198, 200, 202, 204, 206,
43
+ 208, 210, 212, 214, 216, 218, 220, 221,
44
+ 222, 223, 224, 225, 226, 227, 231, 236,
45
+ 241, 246, 251, 255, 259, 261, 262, 263,
46
+ 264, 265, 266, 267, 268, 269, 270, 271,
47
+ 272, 273, 274, 275, 276, 277, 282, 289,
48
+ 294, 298, 304, 307, 309, 315, 329, 332,
49
+ 334, 336, 338, 340, 342, 344, 346, 348,
50
+ 351, 353, 355, 357, 359, 361, 363, 365,
51
+ 367, 369, 371, 373, 375, 377, 379, 381,
52
+ 383, 385, 387, 389, 391, 393, 395, 397,
53
+ 399, 400, 401, 402, 403, 405, 406, 407,
54
+ 408, 409, 410, 411, 412, 413, 425, 427,
55
+ 429, 431, 433, 435, 440, 442, 444, 446,
56
+ 448, 450, 452, 454, 456, 458, 460, 462,
57
+ 464, 466, 468, 470, 472, 474, 476, 478,
58
+ 480, 482, 484, 486, 488, 490, 492, 494,
59
+ 496, 498, 500, 502, 504, 506, 508, 510,
60
+ 512, 514, 516, 518, 519, 520, 532, 534,
61
+ 536, 538, 540, 542, 547, 549, 551, 553,
62
+ 555, 557, 559, 561, 563, 565, 567, 569,
63
+ 571, 573, 576, 578, 580, 582, 584, 586,
64
+ 588, 591, 593, 595, 597, 599, 601, 603,
65
+ 605, 607, 609, 611, 613, 615, 617, 619,
66
+ 621, 623, 625, 627, 629, 631, 633, 635,
67
+ 637, 639, 641, 643, 645, 647, 648, 649,
68
+ 650, 651, 652, 653, 654, 655, 662, 664,
69
+ 666, 668, 670, 672, 674, 675, 676
70
+ ];
71
+
72
+ const _lexer_trans_keys = [
73
+ -28, -27, -24, -23, 10, 32, 34, 35,
74
+ 37, 42, 64, 124, 239, 9, 13, -67,
75
+ -66, -122, -26, -104, -81, 10, 10, 13,
76
+ -28, -27, -24, -23, 10, 32, 34, 35,
77
+ 37, 42, 64, 124, 9, 13, -127, -118,
78
+ -100, -67, -121, -27, -90, -126, -97, -24,
79
+ -125, -67, 58, 10, 10, -28, -27, -24,
80
+ 10, 32, 35, 37, 64, 9, 13, -66,
81
+ 10, -117, 10, -27, 10, -83, 10, -112,
82
+ 10, 10, 58, -28, -27, -24, -23, 10,
83
+ 32, 34, 35, 37, 42, 64, 124, 9,
84
+ 13, -128, -125, -116, -28, -72, -108, -116,
85
+ -26, -103, -81, 58, 10, 10, -28, -27,
86
+ -24, -23, 10, 32, 35, 37, 42, 64,
87
+ 9, 13, -67, 10, -122, 10, -26, 10,
88
+ -104, 10, -81, 10, -127, -118, -100, -67,
89
+ 10, -121, 10, -27, 10, -90, 10, -126,
90
+ 10, -97, 10, -24, 10, -125, 10, -67,
91
+ 10, 10, 58, -70, 10, -26, 10, -103,
92
+ 10, -81, 10, -27, 10, 58, -92, 10,
93
+ -89, 10, -25, 10, -70, 10, -78, 10,
94
+ -109, 10, -128, 10, -116, 10, -28, 10,
95
+ -72, 10, -108, 10, -126, 10, -93, 10,
96
+ -28, 10, -71, 10, -120, 10, 10, 95,
97
+ 10, 70, 10, 69, 10, 65, 10, 84,
98
+ 10, 85, 10, 82, 10, 69, 10, 95,
99
+ 10, 69, 10, 78, 10, 68, 10, 95,
100
+ 10, 37, 10, 32, -126, -93, -28, -71,
101
+ -120, 34, 34, 10, 32, 9, 13, 10,
102
+ 32, 34, 9, 13, 10, 32, 34, 9,
103
+ 13, 10, 32, 34, 9, 13, 10, 32,
104
+ 34, 9, 13, 10, 32, 9, 13, 10,
105
+ 32, 9, 13, 10, 13, 10, 95, 70,
106
+ 69, 65, 84, 85, 82, 69, 95, 69,
107
+ 78, 68, 95, 37, 32, 13, 32, 64,
108
+ 9, 10, 9, 10, 13, 32, 64, 11,
109
+ 12, 10, 32, 64, 9, 13, 32, 124,
110
+ 9, 13, 10, 32, 92, 124, 9, 13,
111
+ 10, 92, 124, 10, 92, 10, 32, 92,
112
+ 124, 9, 13, -28, -27, -24, -23, 10,
113
+ 32, 34, 35, 37, 42, 64, 124, 9,
114
+ 13, -118, -100, 10, -97, 10, -24, 10,
115
+ -125, 10, -67, 10, -70, 10, -26, 10,
116
+ -103, 10, -81, 10, -27, 10, 58, -92,
117
+ 10, -89, 10, -25, 10, -70, 10, -78,
118
+ 10, -125, 10, -116, 10, -26, 10, -103,
119
+ 10, -81, 10, 10, 95, 10, 70, 10,
120
+ 69, 10, 65, 10, 84, 10, 85, 10,
121
+ 82, 10, 69, 10, 95, 10, 69, 10,
122
+ 78, 10, 68, 10, 95, 10, 37, -70,
123
+ -26, -103, -81, -27, 58, -92, -89, -25,
124
+ -70, -78, 58, 10, 10, -28, -27, -24,
125
+ -23, 10, 32, 35, 37, 42, 64, 9,
126
+ 13, -67, 10, -122, 10, -26, 10, -104,
127
+ 10, -81, 10, -127, -118, -100, -67, 10,
128
+ -121, 10, -27, 10, -90, 10, -126, 10,
129
+ -97, 10, -24, 10, -125, 10, -67, 10,
130
+ 10, 58, -70, 10, -26, 10, -103, 10,
131
+ -81, 10, -109, 10, -128, 10, -116, 10,
132
+ -28, 10, -72, 10, -108, 10, -126, 10,
133
+ -93, 10, -28, 10, -71, 10, -120, 10,
134
+ 10, 95, 10, 70, 10, 69, 10, 65,
135
+ 10, 84, 10, 85, 10, 82, 10, 69,
136
+ 10, 95, 10, 69, 10, 78, 10, 68,
137
+ 10, 95, 10, 37, 10, 32, 10, 10,
138
+ -28, -27, -24, -23, 10, 32, 35, 37,
139
+ 42, 64, 9, 13, -67, 10, -122, 10,
140
+ -26, 10, -104, 10, -81, 10, -127, -118,
141
+ -100, -67, 10, -121, 10, -27, 10, -90,
142
+ 10, -126, 10, -97, 10, -24, 10, -125,
143
+ 10, -67, 10, 10, 58, -70, 10, -26,
144
+ 10, -103, 10, -81, 10, -27, 10, 58,
145
+ -92, 10, -89, 10, -25, 10, -70, 10,
146
+ -78, 10, -109, 10, -128, -125, 10, -116,
147
+ 10, -28, 10, -72, 10, -108, 10, -116,
148
+ 10, -26, 10, -103, 10, -81, 10, -126,
149
+ 10, -93, 10, -28, 10, -71, 10, -120,
150
+ 10, 10, 95, 10, 70, 10, 69, 10,
151
+ 65, 10, 84, 10, 85, 10, 82, 10,
152
+ 69, 10, 95, 10, 69, 10, 78, 10,
153
+ 68, 10, 95, 10, 37, 10, 32, -109,
154
+ -117, -27, -83, -112, 58, 10, 10, -27,
155
+ 10, 32, 35, 124, 9, 13, -118, 10,
156
+ -97, 10, -24, 10, -125, 10, -67, 10,
157
+ 10, 58, 187, 191, 0
158
+ ];
159
+
160
+ const _lexer_single_lengths = [
161
+ 0, 13, 2, 1, 1, 1, 1, 1,
162
+ 2, 12, 4, 1, 1, 1, 1, 1,
163
+ 1, 1, 1, 1, 1, 1, 8, 2,
164
+ 2, 2, 2, 2, 2, 12, 2, 1,
165
+ 1, 1, 1, 1, 1, 1, 1, 1,
166
+ 1, 1, 10, 2, 2, 2, 2, 2,
167
+ 5, 2, 2, 2, 2, 2, 2, 2,
168
+ 2, 2, 2, 2, 2, 2, 3, 2,
169
+ 2, 2, 2, 2, 2, 2, 2, 2,
170
+ 2, 2, 2, 2, 2, 2, 2, 2,
171
+ 2, 2, 2, 2, 2, 2, 2, 2,
172
+ 2, 2, 2, 2, 2, 2, 1, 1,
173
+ 1, 1, 1, 1, 1, 2, 3, 3,
174
+ 3, 3, 2, 2, 2, 1, 1, 1,
175
+ 1, 1, 1, 1, 1, 1, 1, 1,
176
+ 1, 1, 1, 1, 1, 3, 5, 3,
177
+ 2, 4, 3, 2, 4, 12, 3, 2,
178
+ 2, 2, 2, 2, 2, 2, 2, 3,
179
+ 2, 2, 2, 2, 2, 2, 2, 2,
180
+ 2, 2, 2, 2, 2, 2, 2, 2,
181
+ 2, 2, 2, 2, 2, 2, 2, 2,
182
+ 1, 1, 1, 1, 2, 1, 1, 1,
183
+ 1, 1, 1, 1, 1, 10, 2, 2,
184
+ 2, 2, 2, 5, 2, 2, 2, 2,
185
+ 2, 2, 2, 2, 2, 2, 2, 2,
186
+ 2, 2, 2, 2, 2, 2, 2, 2,
187
+ 2, 2, 2, 2, 2, 2, 2, 2,
188
+ 2, 2, 2, 2, 2, 2, 2, 2,
189
+ 2, 2, 2, 1, 1, 10, 2, 2,
190
+ 2, 2, 2, 5, 2, 2, 2, 2,
191
+ 2, 2, 2, 2, 2, 2, 2, 2,
192
+ 2, 3, 2, 2, 2, 2, 2, 2,
193
+ 3, 2, 2, 2, 2, 2, 2, 2,
194
+ 2, 2, 2, 2, 2, 2, 2, 2,
195
+ 2, 2, 2, 2, 2, 2, 2, 2,
196
+ 2, 2, 2, 2, 2, 1, 1, 1,
197
+ 1, 1, 1, 1, 1, 5, 2, 2,
198
+ 2, 2, 2, 2, 1, 1, 0
199
+ ];
200
+
201
+ const _lexer_range_lengths = [
202
+ 0, 1, 0, 0, 0, 0, 0, 0,
203
+ 0, 1, 0, 0, 0, 0, 0, 0,
204
+ 0, 0, 0, 0, 0, 0, 1, 0,
205
+ 0, 0, 0, 0, 0, 1, 0, 0,
206
+ 0, 0, 0, 0, 0, 0, 0, 0,
207
+ 0, 0, 1, 0, 0, 0, 0, 0,
208
+ 0, 0, 0, 0, 0, 0, 0, 0,
209
+ 0, 0, 0, 0, 0, 0, 0, 0,
210
+ 0, 0, 0, 0, 0, 0, 0, 0,
211
+ 0, 0, 0, 0, 0, 0, 0, 0,
212
+ 0, 0, 0, 0, 0, 0, 0, 0,
213
+ 0, 0, 0, 0, 0, 0, 0, 0,
214
+ 0, 0, 0, 0, 0, 1, 1, 1,
215
+ 1, 1, 1, 1, 0, 0, 0, 0,
216
+ 0, 0, 0, 0, 0, 0, 0, 0,
217
+ 0, 0, 0, 0, 0, 1, 1, 1,
218
+ 1, 1, 0, 0, 1, 1, 0, 0,
219
+ 0, 0, 0, 0, 0, 0, 0, 0,
220
+ 0, 0, 0, 0, 0, 0, 0, 0,
221
+ 0, 0, 0, 0, 0, 0, 0, 0,
222
+ 0, 0, 0, 0, 0, 0, 0, 0,
223
+ 0, 0, 0, 0, 0, 0, 0, 0,
224
+ 0, 0, 0, 0, 0, 1, 0, 0,
225
+ 0, 0, 0, 0, 0, 0, 0, 0,
226
+ 0, 0, 0, 0, 0, 0, 0, 0,
227
+ 0, 0, 0, 0, 0, 0, 0, 0,
228
+ 0, 0, 0, 0, 0, 0, 0, 0,
229
+ 0, 0, 0, 0, 0, 0, 0, 0,
230
+ 0, 0, 0, 0, 0, 1, 0, 0,
231
+ 0, 0, 0, 0, 0, 0, 0, 0,
232
+ 0, 0, 0, 0, 0, 0, 0, 0,
233
+ 0, 0, 0, 0, 0, 0, 0, 0,
234
+ 0, 0, 0, 0, 0, 0, 0, 0,
235
+ 0, 0, 0, 0, 0, 0, 0, 0,
236
+ 0, 0, 0, 0, 0, 0, 0, 0,
237
+ 0, 0, 0, 0, 0, 0, 0, 0,
238
+ 0, 0, 0, 0, 0, 1, 0, 0,
239
+ 0, 0, 0, 0, 0, 0, 0
240
+ ];
241
+
242
+ const _lexer_index_offsets = [
243
+ 0, 0, 15, 18, 20, 22, 24, 26,
244
+ 28, 31, 45, 50, 52, 54, 56, 58,
245
+ 60, 62, 64, 66, 68, 70, 72, 82,
246
+ 85, 88, 91, 94, 97, 100, 114, 117,
247
+ 119, 121, 123, 125, 127, 129, 131, 133,
248
+ 135, 137, 139, 151, 154, 157, 160, 163,
249
+ 166, 172, 175, 178, 181, 184, 187, 190,
250
+ 193, 196, 199, 202, 205, 208, 211, 215,
251
+ 218, 221, 224, 227, 230, 233, 236, 239,
252
+ 242, 245, 248, 251, 254, 257, 260, 263,
253
+ 266, 269, 272, 275, 278, 281, 284, 287,
254
+ 290, 293, 296, 299, 302, 305, 308, 310,
255
+ 312, 314, 316, 318, 320, 322, 326, 331,
256
+ 336, 341, 346, 350, 354, 357, 359, 361,
257
+ 363, 365, 367, 369, 371, 373, 375, 377,
258
+ 379, 381, 383, 385, 387, 389, 394, 401,
259
+ 406, 410, 416, 420, 423, 429, 443, 447,
260
+ 450, 453, 456, 459, 462, 465, 468, 471,
261
+ 475, 478, 481, 484, 487, 490, 493, 496,
262
+ 499, 502, 505, 508, 511, 514, 517, 520,
263
+ 523, 526, 529, 532, 535, 538, 541, 544,
264
+ 547, 549, 551, 553, 555, 558, 560, 562,
265
+ 564, 566, 568, 570, 572, 574, 586, 589,
266
+ 592, 595, 598, 601, 607, 610, 613, 616,
267
+ 619, 622, 625, 628, 631, 634, 637, 640,
268
+ 643, 646, 649, 652, 655, 658, 661, 664,
269
+ 667, 670, 673, 676, 679, 682, 685, 688,
270
+ 691, 694, 697, 700, 703, 706, 709, 712,
271
+ 715, 718, 721, 724, 726, 728, 740, 743,
272
+ 746, 749, 752, 755, 761, 764, 767, 770,
273
+ 773, 776, 779, 782, 785, 788, 791, 794,
274
+ 797, 800, 804, 807, 810, 813, 816, 819,
275
+ 822, 826, 829, 832, 835, 838, 841, 844,
276
+ 847, 850, 853, 856, 859, 862, 865, 868,
277
+ 871, 874, 877, 880, 883, 886, 889, 892,
278
+ 895, 898, 901, 904, 907, 910, 912, 914,
279
+ 916, 918, 920, 922, 924, 926, 933, 936,
280
+ 939, 942, 945, 948, 951, 953, 955
281
+ ];
282
+
283
+ const _lexer_indicies = [
284
+ 1, 2, 3, 4, 6, 5, 7, 8,
285
+ 9, 10, 11, 12, 13, 5, 0, 14,
286
+ 15, 0, 16, 0, 17, 0, 18, 0,
287
+ 19, 0, 0, 20, 22, 23, 21, 1,
288
+ 2, 3, 4, 6, 5, 7, 8, 9,
289
+ 10, 11, 12, 5, 0, 24, 25, 26,
290
+ 27, 0, 28, 0, 29, 0, 30, 0,
291
+ 19, 0, 31, 0, 32, 0, 33, 0,
292
+ 34, 0, 35, 0, 37, 36, 39, 38,
293
+ 40, 41, 42, 39, 43, 44, 45, 44,
294
+ 43, 38, 46, 39, 38, 47, 39, 38,
295
+ 48, 39, 38, 49, 39, 38, 50, 39,
296
+ 38, 39, 51, 38, 52, 53, 54, 55,
297
+ 57, 56, 58, 59, 60, 61, 62, 63,
298
+ 56, 0, 64, 65, 0, 66, 0, 67,
299
+ 0, 68, 0, 19, 0, 69, 0, 70,
300
+ 0, 71, 0, 72, 0, 73, 0, 75,
301
+ 74, 77, 76, 78, 79, 80, 81, 77,
302
+ 82, 83, 84, 85, 83, 82, 76, 86,
303
+ 77, 76, 87, 77, 76, 88, 77, 76,
304
+ 89, 77, 76, 90, 77, 76, 91, 92,
305
+ 93, 94, 77, 76, 95, 77, 76, 96,
306
+ 77, 76, 97, 77, 76, 90, 77, 76,
307
+ 98, 77, 76, 99, 77, 76, 100, 77,
308
+ 76, 101, 77, 76, 77, 90, 76, 102,
309
+ 77, 76, 103, 77, 76, 104, 77, 76,
310
+ 105, 77, 76, 106, 77, 90, 76, 107,
311
+ 77, 76, 108, 77, 76, 109, 77, 76,
312
+ 110, 77, 76, 101, 77, 76, 90, 77,
313
+ 76, 111, 77, 76, 112, 77, 76, 113,
314
+ 77, 76, 114, 77, 76, 90, 77, 76,
315
+ 115, 77, 76, 116, 77, 76, 117, 77,
316
+ 76, 118, 77, 76, 90, 77, 76, 77,
317
+ 119, 76, 77, 120, 76, 77, 121, 76,
318
+ 77, 122, 76, 77, 123, 76, 77, 124,
319
+ 76, 77, 125, 76, 77, 126, 76, 77,
320
+ 127, 76, 77, 128, 76, 77, 129, 76,
321
+ 77, 130, 76, 77, 131, 76, 77, 132,
322
+ 76, 77, 90, 76, 133, 0, 134, 0,
323
+ 135, 0, 136, 0, 19, 0, 137, 0,
324
+ 138, 0, 139, 138, 138, 0, 142, 141,
325
+ 143, 141, 140, 146, 145, 147, 145, 144,
326
+ 146, 145, 148, 145, 144, 146, 145, 149,
327
+ 145, 144, 151, 150, 150, 0, 6, 152,
328
+ 152, 0, 154, 155, 153, 6, 0, 156,
329
+ 0, 157, 0, 158, 0, 159, 0, 160,
330
+ 0, 161, 0, 162, 0, 163, 0, 164,
331
+ 0, 165, 0, 166, 0, 167, 0, 168,
332
+ 0, 169, 0, 19, 0, 0, 0, 0,
333
+ 0, 170, 171, 172, 171, 171, 174, 173,
334
+ 170, 6, 175, 11, 175, 0, 176, 177,
335
+ 176, 0, 180, 179, 181, 182, 179, 178,
336
+ 0, 184, 185, 183, 0, 184, 183, 180,
337
+ 186, 184, 185, 186, 183, 187, 188, 189,
338
+ 190, 180, 191, 192, 193, 194, 195, 196,
339
+ 197, 191, 0, 198, 199, 39, 38, 200,
340
+ 39, 38, 201, 39, 38, 202, 39, 38,
341
+ 50, 39, 38, 203, 39, 38, 204, 39,
342
+ 38, 205, 39, 38, 206, 39, 38, 207,
343
+ 39, 51, 38, 208, 39, 38, 209, 39,
344
+ 38, 210, 39, 38, 211, 39, 38, 50,
345
+ 39, 38, 212, 39, 38, 213, 39, 38,
346
+ 214, 39, 38, 215, 39, 38, 50, 39,
347
+ 38, 39, 216, 38, 39, 217, 38, 39,
348
+ 218, 38, 39, 219, 38, 39, 220, 38,
349
+ 39, 221, 38, 39, 222, 38, 39, 223,
350
+ 38, 39, 224, 38, 39, 225, 38, 39,
351
+ 226, 38, 39, 227, 38, 39, 228, 38,
352
+ 39, 229, 38, 230, 0, 231, 0, 232,
353
+ 0, 233, 0, 234, 235, 0, 236, 0,
354
+ 237, 0, 238, 0, 239, 0, 240, 0,
355
+ 241, 0, 243, 242, 245, 244, 246, 247,
356
+ 248, 249, 245, 250, 251, 252, 253, 251,
357
+ 250, 244, 254, 245, 244, 255, 245, 244,
358
+ 256, 245, 244, 257, 245, 244, 258, 245,
359
+ 244, 259, 260, 261, 262, 245, 244, 263,
360
+ 245, 244, 264, 245, 244, 265, 245, 244,
361
+ 258, 245, 244, 266, 245, 244, 267, 245,
362
+ 244, 268, 245, 244, 269, 245, 244, 245,
363
+ 258, 244, 270, 245, 244, 271, 245, 244,
364
+ 272, 245, 244, 269, 245, 244, 258, 245,
365
+ 244, 273, 245, 244, 274, 245, 244, 275,
366
+ 245, 244, 276, 245, 244, 258, 245, 244,
367
+ 277, 245, 244, 278, 245, 244, 279, 245,
368
+ 244, 280, 245, 244, 258, 245, 244, 245,
369
+ 281, 244, 245, 282, 244, 245, 283, 244,
370
+ 245, 284, 244, 245, 285, 244, 245, 286,
371
+ 244, 245, 287, 244, 245, 288, 244, 245,
372
+ 289, 244, 245, 290, 244, 245, 291, 244,
373
+ 245, 292, 244, 245, 293, 244, 245, 294,
374
+ 244, 245, 258, 244, 296, 295, 298, 297,
375
+ 299, 300, 301, 302, 298, 303, 304, 305,
376
+ 306, 304, 303, 297, 307, 298, 297, 308,
377
+ 298, 297, 309, 298, 297, 310, 298, 297,
378
+ 311, 298, 297, 312, 313, 314, 315, 298,
379
+ 297, 316, 298, 297, 317, 298, 297, 318,
380
+ 298, 297, 311, 298, 297, 319, 298, 297,
381
+ 320, 298, 297, 321, 298, 297, 322, 298,
382
+ 297, 298, 311, 297, 323, 298, 297, 324,
383
+ 298, 297, 325, 298, 297, 326, 298, 297,
384
+ 327, 298, 311, 297, 328, 298, 297, 329,
385
+ 298, 297, 330, 298, 297, 331, 298, 297,
386
+ 322, 298, 297, 311, 298, 297, 332, 333,
387
+ 298, 297, 334, 298, 297, 335, 298, 297,
388
+ 336, 298, 297, 311, 298, 297, 337, 298,
389
+ 297, 338, 298, 297, 339, 298, 297, 322,
390
+ 298, 297, 340, 298, 297, 341, 298, 297,
391
+ 342, 298, 297, 343, 298, 297, 311, 298,
392
+ 297, 298, 344, 297, 298, 345, 297, 298,
393
+ 346, 297, 298, 347, 297, 298, 348, 297,
394
+ 298, 349, 297, 298, 350, 297, 298, 351,
395
+ 297, 298, 352, 297, 298, 353, 297, 298,
396
+ 354, 297, 298, 355, 297, 298, 356, 297,
397
+ 298, 357, 297, 298, 311, 297, 19, 0,
398
+ 358, 0, 359, 0, 360, 0, 361, 0,
399
+ 362, 0, 364, 363, 366, 365, 367, 366,
400
+ 368, 369, 369, 368, 365, 370, 366, 365,
401
+ 371, 366, 365, 372, 366, 365, 373, 366,
402
+ 365, 374, 366, 365, 366, 375, 365, 376,
403
+ 0, 5, 0, 377, 0
404
+ ];
405
+
406
+ const _lexer_trans_targs = [
407
+ 0, 2, 10, 30, 94, 9, 9, 99,
408
+ 108, 110, 124, 125, 128, 300, 3, 286,
409
+ 4, 5, 6, 7, 8, 8, 9, 109,
410
+ 11, 15, 168, 285, 12, 13, 14, 16,
411
+ 17, 18, 19, 20, 21, 22, 21, 22,
412
+ 23, 134, 149, 22, 9, 154, 24, 25,
413
+ 26, 27, 28, 29, 2, 10, 30, 94,
414
+ 9, 9, 99, 108, 110, 124, 125, 128,
415
+ 31, 35, 32, 33, 34, 36, 37, 38,
416
+ 39, 40, 41, 42, 41, 42, 43, 48,
417
+ 69, 74, 42, 9, 79, 93, 44, 45,
418
+ 46, 47, 29, 49, 53, 58, 68, 50,
419
+ 51, 52, 54, 55, 56, 57, 59, 60,
420
+ 61, 62, 63, 64, 65, 66, 67, 70,
421
+ 71, 72, 73, 75, 76, 77, 78, 80,
422
+ 81, 82, 83, 84, 85, 86, 87, 88,
423
+ 89, 90, 91, 92, 9, 95, 96, 97,
424
+ 98, 100, 101, 102, 103, 103, 103, 104,
425
+ 103, 103, 103, 104, 105, 106, 107, 9,
426
+ 107, 108, 9, 109, 111, 112, 113, 114,
427
+ 115, 116, 117, 118, 119, 120, 121, 122,
428
+ 123, 302, 126, 127, 9, 126, 125, 127,
429
+ 128, 129, 130, 132, 133, 131, 129, 130,
430
+ 131, 129, 132, 2, 10, 30, 94, 133,
431
+ 99, 108, 110, 124, 125, 128, 135, 139,
432
+ 136, 137, 138, 140, 141, 142, 143, 144,
433
+ 145, 146, 147, 148, 150, 151, 152, 153,
434
+ 155, 156, 157, 158, 159, 160, 161, 162,
435
+ 163, 164, 165, 166, 167, 9, 169, 170,
436
+ 171, 172, 173, 227, 174, 175, 176, 177,
437
+ 178, 179, 180, 181, 180, 181, 182, 187,
438
+ 202, 207, 181, 9, 212, 226, 183, 184,
439
+ 185, 186, 29, 188, 192, 197, 201, 189,
440
+ 190, 191, 193, 194, 195, 196, 198, 199,
441
+ 200, 203, 204, 205, 206, 208, 209, 210,
442
+ 211, 213, 214, 215, 216, 217, 218, 219,
443
+ 220, 221, 222, 223, 224, 225, 9, 228,
444
+ 229, 228, 229, 230, 235, 256, 265, 229,
445
+ 9, 270, 284, 231, 232, 233, 234, 29,
446
+ 236, 240, 245, 255, 237, 238, 239, 241,
447
+ 242, 243, 244, 246, 247, 248, 249, 250,
448
+ 251, 252, 253, 254, 257, 261, 258, 259,
449
+ 260, 262, 263, 264, 266, 267, 268, 269,
450
+ 271, 272, 273, 274, 275, 276, 277, 278,
451
+ 279, 280, 281, 282, 283, 9, 287, 288,
452
+ 289, 290, 291, 292, 293, 292, 293, 294,
453
+ 293, 9, 295, 296, 297, 298, 299, 29,
454
+ 301, 0
455
+ ];
456
+
457
+ const _lexer_trans_actions = [
458
+ 39, 25, 25, 25, 25, 0, 47, 3,
459
+ 1, 0, 25, 1, 31, 0, 0, 0,
460
+ 0, 0, 0, 0, 50, 0, 99, 19,
461
+ 0, 0, 0, 0, 0, 0, 0, 0,
462
+ 0, 0, 0, 0, 50, 124, 0, 47,
463
+ 77, 77, 77, 0, 62, 29, 0, 0,
464
+ 0, 0, 0, 9, 56, 56, 56, 56,
465
+ 27, 115, 53, 50, 27, 56, 50, 59,
466
+ 0, 0, 0, 0, 0, 0, 0, 0,
467
+ 0, 0, 50, 124, 0, 47, 77, 77,
468
+ 77, 77, 0, 65, 29, 77, 0, 0,
469
+ 0, 0, 11, 0, 0, 0, 0, 0,
470
+ 0, 0, 0, 0, 0, 0, 0, 0,
471
+ 0, 0, 0, 0, 0, 0, 0, 0,
472
+ 0, 0, 0, 0, 0, 0, 0, 0,
473
+ 0, 0, 0, 0, 0, 0, 0, 0,
474
+ 0, 0, 0, 0, 11, 0, 0, 0,
475
+ 0, 0, 0, 47, 5, 41, 119, 41,
476
+ 0, 29, 111, 29, 29, 0, 7, 95,
477
+ 0, 0, 103, 21, 0, 0, 0, 0,
478
+ 0, 0, 0, 0, 0, 0, 0, 0,
479
+ 0, 0, 0, 23, 107, 23, 44, 0,
480
+ 0, 0, 33, 33, 47, 33, 80, 0,
481
+ 0, 35, 0, 89, 89, 89, 89, 0,
482
+ 86, 83, 37, 89, 83, 92, 0, 0,
483
+ 0, 0, 0, 0, 0, 0, 0, 0,
484
+ 0, 0, 0, 0, 0, 0, 0, 0,
485
+ 0, 0, 0, 0, 0, 0, 0, 0,
486
+ 0, 0, 0, 0, 0, 9, 0, 0,
487
+ 0, 0, 0, 0, 0, 0, 0, 0,
488
+ 0, 0, 50, 124, 0, 47, 77, 77,
489
+ 77, 77, 0, 71, 29, 77, 0, 0,
490
+ 0, 0, 15, 0, 0, 0, 0, 0,
491
+ 0, 0, 0, 0, 0, 0, 0, 0,
492
+ 0, 0, 0, 0, 0, 0, 0, 0,
493
+ 0, 0, 0, 0, 0, 0, 0, 0,
494
+ 0, 0, 0, 0, 0, 0, 15, 50,
495
+ 124, 0, 47, 77, 77, 77, 77, 0,
496
+ 68, 29, 77, 0, 0, 0, 0, 13,
497
+ 0, 0, 0, 0, 0, 0, 0, 0,
498
+ 0, 0, 0, 0, 0, 0, 0, 0,
499
+ 0, 0, 0, 0, 0, 0, 0, 0,
500
+ 0, 0, 0, 0, 0, 0, 0, 0,
501
+ 0, 0, 0, 0, 0, 0, 0, 0,
502
+ 0, 0, 0, 0, 0, 13, 0, 0,
503
+ 0, 0, 0, 50, 124, 0, 47, 77,
504
+ 0, 74, 0, 0, 0, 0, 0, 17,
505
+ 0, 0
506
+ ];
507
+
508
+ const _lexer_eof_actions = [
509
+ 0, 39, 39, 39, 39, 39, 39, 39,
510
+ 39, 39, 39, 39, 39, 39, 39, 39,
511
+ 39, 39, 39, 39, 39, 39, 39, 39,
512
+ 39, 39, 39, 39, 39, 39, 39, 39,
513
+ 39, 39, 39, 39, 39, 39, 39, 39,
514
+ 39, 39, 39, 39, 39, 39, 39, 39,
515
+ 39, 39, 39, 39, 39, 39, 39, 39,
516
+ 39, 39, 39, 39, 39, 39, 39, 39,
517
+ 39, 39, 39, 39, 39, 39, 39, 39,
518
+ 39, 39, 39, 39, 39, 39, 39, 39,
519
+ 39, 39, 39, 39, 39, 39, 39, 39,
520
+ 39, 39, 39, 39, 39, 39, 39, 39,
521
+ 39, 39, 39, 39, 39, 39, 39, 39,
522
+ 39, 39, 39, 39, 39, 39, 39, 39,
523
+ 39, 39, 39, 39, 39, 39, 39, 39,
524
+ 39, 39, 39, 39, 39, 39, 39, 39,
525
+ 39, 39, 39, 39, 39, 39, 39, 39,
526
+ 39, 39, 39, 39, 39, 39, 39, 39,
527
+ 39, 39, 39, 39, 39, 39, 39, 39,
528
+ 39, 39, 39, 39, 39, 39, 39, 39,
529
+ 39, 39, 39, 39, 39, 39, 39, 39,
530
+ 39, 39, 39, 39, 39, 39, 39, 39,
531
+ 39, 39, 39, 39, 39, 39, 39, 39,
532
+ 39, 39, 39, 39, 39, 39, 39, 39,
533
+ 39, 39, 39, 39, 39, 39, 39, 39,
534
+ 39, 39, 39, 39, 39, 39, 39, 39,
535
+ 39, 39, 39, 39, 39, 39, 39, 39,
536
+ 39, 39, 39, 39, 39, 39, 39, 39,
537
+ 39, 39, 39, 39, 39, 39, 39, 39,
538
+ 39, 39, 39, 39, 39, 39, 39, 39,
539
+ 39, 39, 39, 39, 39, 39, 39, 39,
540
+ 39, 39, 39, 39, 39, 39, 39, 39,
541
+ 39, 39, 39, 39, 39, 39, 39, 39,
542
+ 39, 39, 39, 39, 39, 39, 39, 39,
543
+ 39, 39, 39, 39, 39, 39, 39, 39,
544
+ 39, 39, 39, 39, 39, 39, 39, 39,
545
+ 39, 39, 39, 39, 39, 39, 39, 39,
546
+ 39, 39, 39, 39, 39, 39, 39
547
+ ];
548
+
549
+ const lexer_start = 1;
550
+ const lexer_first_final = 302;
551
+ const lexer_error = 0;
552
+
553
+ const lexer_en_main = 1;
554
+
555
+
556
+ /* line 110 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
557
+
558
+ /* line 111 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
559
+
560
+ /* line 112 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
561
+
562
+ var Lexer = function(listeners) {
563
+ // check that we have an 'on' method (for registering event listeners - Node has that)
564
+ // If not, make a trivial implementation that can register one listener. -Enough for testing.
565
+
566
+ if(!this.on) {
567
+ this._listeners = {};
568
+
569
+ this.on = function(event, cb) {
570
+ this._listeners[event] = cb;
571
+ };
572
+
573
+ this.emit = function() {
574
+ var event = arguments[0];
575
+ var args = [];
576
+ for(var i = 1; i < arguments.length; i++) {
577
+ args.push(arguments[i]);
578
+ }
579
+ var cb = this._listeners[event];
580
+ cb.apply(listeners, args);
581
+ };
582
+ }
583
+
584
+ var events = ['feature', 'background', 'scenario', 'scenario_outline', 'examples', 'step', 'py_string', 'row', 'end'];
585
+ for(e in events) {
586
+ var event = events[e];
587
+ var listener = listeners[event];
588
+ // if(!listener) {
589
+ // throw "No listener for " + event;
590
+ // }
591
+ this.on(event, listener);
592
+ }
593
+
594
+
595
+ /* line 596 "js/lib/gherkin/lexer/i18n/zh_cn.js" */
596
+ {
597
+ this.cs = lexer_start;
598
+ } /* JSCodeGen::writeInit */
599
+
600
+ /* line 146 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
601
+ };
602
+
603
+ if(typeof require == 'function') {
604
+ require('sys').inherits(Lexer, require('events').EventEmitter);
605
+ }
606
+
607
+ Lexer.prototype.scan = function(data) {
608
+ var p = 0;
609
+ var pe = data.length;
610
+ var eof = 0;
611
+
612
+
613
+ /* line 614 "js/lib/gherkin/lexer/i18n/zh_cn.js" */
614
+ {
615
+ var _klen, _trans, _keys, _ps, _widec, _acts, _nacts;
616
+ var _goto_level, _resume, _eof_trans, _again, _test_eof;
617
+ var _out;
618
+ _klen = _trans = _keys = _acts = _nacts = null;
619
+ _goto_level = 0;
620
+ _resume = 10;
621
+ _eof_trans = 15;
622
+ _again = 20;
623
+ _test_eof = 30;
624
+ _out = 40;
625
+ while (true) {
626
+ _trigger_goto = false;
627
+ if (_goto_level <= 0) {
628
+ if (p == pe) {
629
+ _goto_level = _test_eof;
630
+ continue;
631
+ }
632
+ if ( this.cs == 0) {
633
+ _goto_level = _out;
634
+ continue;
635
+ }
636
+ }
637
+ if (_goto_level <= _resume) {
638
+ _keys = _lexer_key_offsets[ this.cs];
639
+ _trans = _lexer_index_offsets[ this.cs];
640
+ _klen = _lexer_single_lengths[ this.cs];
641
+ _break_match = false;
642
+
643
+ do {
644
+ if (_klen > 0) {
645
+ _lower = _keys;
646
+ _upper = _keys + _klen - 1;
647
+
648
+ while (true) {
649
+ if (_upper < _lower) { break; }
650
+ _mid = _lower + ( (_upper - _lower) >> 1 );
651
+
652
+ if ( data[p] < _lexer_trans_keys[_mid]) {
653
+ _upper = _mid - 1;
654
+ } else if ( data[p] > _lexer_trans_keys[_mid]) {
655
+ _lower = _mid + 1;
656
+ } else {
657
+ _trans += (_mid - _keys);
658
+ _break_match = true;
659
+ break;
660
+ };
661
+ } /* while */
662
+ if (_break_match) { break; }
663
+ _keys += _klen;
664
+ _trans += _klen;
665
+ }
666
+ _klen = _lexer_range_lengths[ this.cs];
667
+ if (_klen > 0) {
668
+ _lower = _keys;
669
+ _upper = _keys + (_klen << 1) - 2;
670
+ while (true) {
671
+ if (_upper < _lower) { break; }
672
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
673
+ if ( data[p] < _lexer_trans_keys[_mid]) {
674
+ _upper = _mid - 2;
675
+ } else if ( data[p] > _lexer_trans_keys[_mid+1]) {
676
+ _lower = _mid + 2;
677
+ } else {
678
+ _trans += ((_mid - _keys) >> 1);
679
+ _break_match = true;
680
+ break;
681
+ }
682
+ } /* while */
683
+ if (_break_match) { break; }
684
+ _trans += _klen
685
+ }
686
+ } while (false);
687
+ _trans = _lexer_indicies[_trans];
688
+ this.cs = _lexer_trans_targs[_trans];
689
+ if (_lexer_trans_actions[_trans] != 0) {
690
+ _acts = _lexer_trans_actions[_trans];
691
+ _nacts = _lexer_actions[_acts];
692
+ _acts += 1;
693
+ while (_nacts > 0) {
694
+ _nacts -= 1;
695
+ _acts += 1;
696
+ switch (_lexer_actions[_acts - 1]) {
697
+ case 0:
698
+ /* line 6 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
699
+
700
+ this.content_start = p;
701
+ this.current_line = this.line_number;
702
+ this.start_col = p - this.last_newline - (this.keyword+':').length;
703
+ break;
704
+ case 1:
705
+ /* line 12 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
706
+
707
+ this.current_line = this.line_number;
708
+ this.start_col = p - this.last_newline;
709
+ break;
710
+ case 2:
711
+ /* line 17 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
712
+
713
+ this.content_start = p;
714
+ break;
715
+ case 3:
716
+ /* line 21 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
717
+
718
+ var con = this.unindent(
719
+ this.start_col,
720
+ this.bytesToString(data.slice(this.content_start, this.next_keyword_start-1)).replace(/(\r?\n)?([\t ])*\Z/, '') // TODO .replace(/\"\"\"/mg, '"""')
721
+ );
722
+ this.emit('py_string', con, this.current_line);
723
+ break;
724
+ case 4:
725
+ /* line 29 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
726
+
727
+ p = this.store_keyword_content('feature', data, p, eof);
728
+ break;
729
+ case 5:
730
+ /* line 33 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
731
+
732
+ p = this.store_keyword_content('background', data, p, eof);
733
+ break;
734
+ case 6:
735
+ /* line 37 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
736
+
737
+ p = this.store_keyword_content('scenario', data, p, eof);
738
+ break;
739
+ case 7:
740
+ /* line 41 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
741
+
742
+ p = this.store_keyword_content('scenario_outline', data, p, eof);
743
+ break;
744
+ case 8:
745
+ /* line 45 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
746
+
747
+ p = this.store_keyword_content('examples', data, p, eof);
748
+ break;
749
+ case 9:
750
+ /* line 49 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
751
+
752
+ var con = this.bytesToString(data.slice(this.content_start, p)).trim();
753
+ this.emit('step', this.keyword, con, this.current_line);
754
+ break;
755
+ case 10:
756
+ /* line 54 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
757
+
758
+ console.log('TODO: store_comment_content');
759
+ break;
760
+ case 11:
761
+ /* line 58 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
762
+
763
+ console.log('TODO: store_tag_content');
764
+ break;
765
+ case 12:
766
+ /* line 62 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
767
+
768
+ this.line_number++;
769
+ break;
770
+ case 13:
771
+ /* line 66 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
772
+
773
+ this.last_newline = p + 1;
774
+ break;
775
+ case 14:
776
+ /* line 70 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
777
+
778
+ this.keyword_start = this.keyword_start || p;
779
+ break;
780
+ case 15:
781
+ /* line 74 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
782
+
783
+ this.keyword = this.bytesToString(data.slice(this.keyword_start, p)).replace(/:$/, '');
784
+ this.keyword_start = null;
785
+ break;
786
+ case 16:
787
+ /* line 79 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
788
+
789
+ this.next_keyword_start = p;
790
+ break;
791
+ case 17:
792
+ /* line 83 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
793
+
794
+ p = p - 1;
795
+ current_row = [];
796
+ this.current_line = this.line_number;
797
+ break;
798
+ case 18:
799
+ /* line 89 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
800
+
801
+ this.content_start = p;
802
+ break;
803
+ case 19:
804
+ /* line 93 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
805
+
806
+ var con = this.bytesToString(data.slice(this.content_start, p)).trim();
807
+ current_row.push(con.replace(/\\\|/, "|").replace(/\\n/, "\n").replace(/\\\\/, "\\"));
808
+ break;
809
+ case 20:
810
+ /* line 98 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
811
+
812
+ this.emit('row', current_row, this.current_line);
813
+ break;
814
+ case 21:
815
+ /* line 102 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
816
+
817
+ console.log('TODO: end_feature');
818
+ break;
819
+ /* line 820 "js/lib/gherkin/lexer/i18n/zh_cn.js" */
820
+ } /* action switch */
821
+ }
822
+ }
823
+ if (_trigger_goto) {
824
+ continue;
825
+ }
826
+ }
827
+ if (_goto_level <= _again) {
828
+ if ( this.cs == 0) {
829
+ _goto_level = _out;
830
+ continue;
831
+ }
832
+ p += 1;
833
+ if (p != pe) {
834
+ _goto_level = _resume;
835
+ continue;
836
+ }
837
+ }
838
+ if (_goto_level <= _test_eof) {
839
+ if (p == eof) {
840
+ __acts = _lexer_eof_actions[ this.cs];
841
+ __nacts = _lexer_actions[__acts];
842
+ __acts += 1;
843
+ while (__nacts > 0) {
844
+ __nacts -= 1;
845
+ __acts += 1;
846
+ switch (_lexer_actions[__acts - 1]) {
847
+ case 21:
848
+ /* line 102 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
849
+
850
+ console.log('TODO: end_feature');
851
+ break;
852
+ /* line 853 "js/lib/gherkin/lexer/i18n/zh_cn.js" */
853
+ } /* eof action switch */
854
+ }
855
+ if (_trigger_goto) {
856
+ continue;
857
+ }
858
+ }
859
+ }
860
+ if (_goto_level <= _out) {
861
+ break;
862
+ }
863
+ }
864
+ }
865
+
866
+ /* line 158 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/zh_cn.js.rl" */
867
+ };
868
+
869
+ Lexer.prototype.bytesToString = function(bytes) {
870
+ if(typeof bytes.write == 'function') {
871
+ // Node.js
872
+ return bytes.toString('utf-8');
873
+ } else {
874
+ var result = "";
875
+ for(var b in bytes) {
876
+ result += String.fromCharCode(bytes[b]);
877
+ }
878
+ return result;
879
+ }
880
+ }
881
+
882
+ Lexer.prototype.unindent = function(startcol, text) {
883
+ startcol = startcol || 0;
884
+ return text.replace(new RegExp('^[\t ]{0,' + startcol + '}', 'gm'), '');
885
+ };
886
+
887
+ Lexer.prototype.store_keyword_content = function(event, data, p, eof) {
888
+ var end_point = (!this.next_keyword_start || (p == eof)) ? p : this.next_keyword_start;
889
+ var content = this.unindent(this.start_col + 2, this.bytesToString(data.slice(this.content_start, end_point))).trimRight();
890
+ var content_lines = content.split("\n")
891
+ var name = content_lines.shift() || "";
892
+ name = name.trim();
893
+ var description = content_lines.join("\n");
894
+ this.emit(event, this.keyword, name, description, this.current_line);
895
+ var nks = this.next_keyword_start;
896
+ this.next_keyword_start = null;
897
+ return nks ? nks - 1 : p;
898
+ };
899
+
900
+ exports.Lexer = Lexer;
901
+
902
+ })();