gherkin 2.12.2 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (333) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -15
  3. data/CONTRIBUTING.md +23 -0
  4. data/Gemfile +0 -3
  5. data/LICENSE +18 -17
  6. data/Makefile +65 -0
  7. data/README.md +9 -268
  8. data/Rakefile +17 -19
  9. data/bin/gherkin-generate-ast +21 -0
  10. data/bin/gherkin-generate-pickles +25 -0
  11. data/bin/gherkin-generate-tokens +12 -0
  12. data/gherkin-ruby.razor +218 -0
  13. data/gherkin.gemspec +22 -76
  14. data/lib/gherkin/ast_builder.rb +243 -0
  15. data/lib/gherkin/ast_node.rb +30 -0
  16. data/lib/gherkin/dialect.rb +58 -0
  17. data/lib/gherkin/errors.rb +45 -0
  18. data/lib/gherkin/gherkin-languages.json +2968 -0
  19. data/lib/gherkin/gherkin_line.rb +95 -0
  20. data/lib/gherkin/parser.rb +1910 -0
  21. data/lib/gherkin/pickles/compiler.rb +164 -0
  22. data/lib/gherkin/token.rb +18 -0
  23. data/lib/gherkin/token_formatter_builder.rb +39 -0
  24. data/lib/gherkin/token_matcher.rb +169 -0
  25. data/lib/gherkin/token_scanner.rb +40 -0
  26. data/spec/capture_warnings.rb +68 -0
  27. data/spec/coverage.rb +10 -0
  28. data/spec/gherkin/parser_spec.rb +146 -0
  29. metadata +60 -567
  30. data/.gitattributes +0 -2
  31. data/.mailmap +0 -2
  32. data/.rbenv-gemsets +0 -1
  33. data/.rspec +0 -1
  34. data/.ruby-gemset +0 -1
  35. data/.ruby-version +0 -1
  36. data/.yardopts +0 -5
  37. data/History.md +0 -881
  38. data/build_native_gems.sh +0 -7
  39. data/cucumber.yml +0 -5
  40. data/examples/parse_and_output_json.rb +0 -19
  41. data/ext/gherkin_lexer_ar/extconf.rb +0 -6
  42. data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +0 -1432
  43. data/ext/gherkin_lexer_bg/extconf.rb +0 -6
  44. data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +0 -1655
  45. data/ext/gherkin_lexer_bm/extconf.rb +0 -6
  46. data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +0 -1516
  47. data/ext/gherkin_lexer_ca/extconf.rb +0 -6
  48. data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +0 -1581
  49. data/ext/gherkin_lexer_cs/extconf.rb +0 -6
  50. data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +0 -1515
  51. data/ext/gherkin_lexer_cy_gb/extconf.rb +0 -6
  52. data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +0 -1282
  53. data/ext/gherkin_lexer_da/extconf.rb +0 -6
  54. data/ext/gherkin_lexer_da/gherkin_lexer_da.c +0 -1298
  55. data/ext/gherkin_lexer_de/extconf.rb +0 -6
  56. data/ext/gherkin_lexer_de/gherkin_lexer_de.c +0 -1425
  57. data/ext/gherkin_lexer_el/extconf.rb +0 -6
  58. data/ext/gherkin_lexer_el/gherkin_lexer_el.c +0 -1919
  59. data/ext/gherkin_lexer_en/extconf.rb +0 -6
  60. data/ext/gherkin_lexer_en/gherkin_lexer_en.c +0 -1418
  61. data/ext/gherkin_lexer_en_au/extconf.rb +0 -6
  62. data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +0 -1765
  63. data/ext/gherkin_lexer_en_lol/extconf.rb +0 -6
  64. data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +0 -1177
  65. data/ext/gherkin_lexer_en_old/extconf.rb +0 -6
  66. data/ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c +0 -1309
  67. data/ext/gherkin_lexer_en_pirate/extconf.rb +0 -6
  68. data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +0 -1471
  69. data/ext/gherkin_lexer_en_scouse/extconf.rb +0 -6
  70. data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +0 -1634
  71. data/ext/gherkin_lexer_en_tx/extconf.rb +0 -6
  72. data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +0 -1265
  73. data/ext/gherkin_lexer_eo/extconf.rb +0 -6
  74. data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +0 -1241
  75. data/ext/gherkin_lexer_es/extconf.rb +0 -6
  76. data/ext/gherkin_lexer_es/gherkin_lexer_es.c +0 -1399
  77. data/ext/gherkin_lexer_et/extconf.rb +0 -6
  78. data/ext/gherkin_lexer_et/gherkin_lexer_et.c +0 -1236
  79. data/ext/gherkin_lexer_fa/extconf.rb +0 -6
  80. data/ext/gherkin_lexer_fa/gherkin_lexer_fa.c +0 -1475
  81. data/ext/gherkin_lexer_fi/extconf.rb +0 -6
  82. data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +0 -1215
  83. data/ext/gherkin_lexer_fr/extconf.rb +0 -6
  84. data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +0 -1493
  85. data/ext/gherkin_lexer_gl/extconf.rb +0 -6
  86. data/ext/gherkin_lexer_gl/gherkin_lexer_gl.c +0 -1374
  87. data/ext/gherkin_lexer_he/extconf.rb +0 -6
  88. data/ext/gherkin_lexer_he/gherkin_lexer_he.c +0 -1374
  89. data/ext/gherkin_lexer_hi/extconf.rb +0 -6
  90. data/ext/gherkin_lexer_hi/gherkin_lexer_hi.c +0 -1848
  91. data/ext/gherkin_lexer_hr/extconf.rb +0 -6
  92. data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +0 -1323
  93. data/ext/gherkin_lexer_hu/extconf.rb +0 -6
  94. data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +0 -1376
  95. data/ext/gherkin_lexer_id/extconf.rb +0 -6
  96. data/ext/gherkin_lexer_id/gherkin_lexer_id.c +0 -1208
  97. data/ext/gherkin_lexer_is/extconf.rb +0 -6
  98. data/ext/gherkin_lexer_is/gherkin_lexer_is.c +0 -1376
  99. data/ext/gherkin_lexer_it/extconf.rb +0 -6
  100. data/ext/gherkin_lexer_it/gherkin_lexer_it.c +0 -1340
  101. data/ext/gherkin_lexer_ja/extconf.rb +0 -6
  102. data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +0 -1699
  103. data/ext/gherkin_lexer_kn/extconf.rb +0 -6
  104. data/ext/gherkin_lexer_kn/gherkin_lexer_kn.c +0 -1965
  105. data/ext/gherkin_lexer_ko/extconf.rb +0 -6
  106. data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +0 -1360
  107. data/ext/gherkin_lexer_lt/extconf.rb +0 -6
  108. data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +0 -1296
  109. data/ext/gherkin_lexer_lu/extconf.rb +0 -6
  110. data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +0 -1389
  111. data/ext/gherkin_lexer_lv/extconf.rb +0 -6
  112. data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +0 -1425
  113. data/ext/gherkin_lexer_nl/extconf.rb +0 -6
  114. data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +0 -1368
  115. data/ext/gherkin_lexer_no/extconf.rb +0 -6
  116. data/ext/gherkin_lexer_no/gherkin_lexer_no.c +0 -1311
  117. data/ext/gherkin_lexer_pa/extconf.rb +0 -6
  118. data/ext/gherkin_lexer_pa/gherkin_lexer_pa.c +0 -2160
  119. data/ext/gherkin_lexer_pl/extconf.rb +0 -6
  120. data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +0 -1738
  121. data/ext/gherkin_lexer_pt/extconf.rb +0 -6
  122. data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +0 -1711
  123. data/ext/gherkin_lexer_ro/extconf.rb +0 -6
  124. data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +0 -1427
  125. data/ext/gherkin_lexer_ru/extconf.rb +0 -6
  126. data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +0 -2071
  127. data/ext/gherkin_lexer_sk/extconf.rb +0 -6
  128. data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +0 -1739
  129. data/ext/gherkin_lexer_sr_cyrl/extconf.rb +0 -6
  130. data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +0 -2112
  131. data/ext/gherkin_lexer_sr_latn/extconf.rb +0 -6
  132. data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +0 -1567
  133. data/ext/gherkin_lexer_sv/extconf.rb +0 -6
  134. data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +0 -1324
  135. data/ext/gherkin_lexer_th/extconf.rb +0 -6
  136. data/ext/gherkin_lexer_th/gherkin_lexer_th.c +0 -2840
  137. data/ext/gherkin_lexer_tl/extconf.rb +0 -6
  138. data/ext/gherkin_lexer_tl/gherkin_lexer_tl.c +0 -2021
  139. data/ext/gherkin_lexer_tr/extconf.rb +0 -6
  140. data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +0 -1347
  141. data/ext/gherkin_lexer_tt/extconf.rb +0 -6
  142. data/ext/gherkin_lexer_tt/gherkin_lexer_tt.c +0 -1936
  143. data/ext/gherkin_lexer_uk/extconf.rb +0 -6
  144. data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +0 -1941
  145. data/ext/gherkin_lexer_uz/extconf.rb +0 -6
  146. data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +0 -1651
  147. data/ext/gherkin_lexer_vi/extconf.rb +0 -6
  148. data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +0 -1458
  149. data/ext/gherkin_lexer_zh_cn/extconf.rb +0 -6
  150. data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +0 -1314
  151. data/ext/gherkin_lexer_zh_tw/extconf.rb +0 -6
  152. data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +0 -1307
  153. data/features/.cucumber/stepdefs.json +0 -244
  154. data/features/escaped_pipes.feature +0 -8
  155. data/features/feature_parser.feature +0 -237
  156. data/features/json_formatter.feature +0 -498
  157. data/features/json_parser.feature +0 -331
  158. data/features/native_lexer.feature +0 -19
  159. data/features/parser_with_native_lexer.feature +0 -205
  160. data/features/pretty_formatter.feature +0 -17
  161. data/features/step_definitions/eyeball_steps.rb +0 -3
  162. data/features/step_definitions/gherkin_steps.rb +0 -29
  163. data/features/step_definitions/json_formatter_steps.rb +0 -30
  164. data/features/step_definitions/json_parser_steps.rb +0 -21
  165. data/features/step_definitions/pretty_formatter_steps.rb +0 -85
  166. data/features/steps_parser.feature +0 -46
  167. data/features/support/env.rb +0 -41
  168. data/install_mingw_os_x.sh +0 -5
  169. data/js/.npmignore +0 -1
  170. data/js/lib/gherkin/lexer/.npmignore +0 -0
  171. data/lib/gherkin.rb +0 -2
  172. data/lib/gherkin/README.md +0 -7
  173. data/lib/gherkin/c_lexer.rb +0 -17
  174. data/lib/gherkin/formatter/ansi_escapes.rb +0 -97
  175. data/lib/gherkin/formatter/argument.rb +0 -16
  176. data/lib/gherkin/formatter/escaping.rb +0 -15
  177. data/lib/gherkin/formatter/filter_formatter.rb +0 -150
  178. data/lib/gherkin/formatter/hashable.rb +0 -25
  179. data/lib/gherkin/formatter/json_formatter.rb +0 -133
  180. data/lib/gherkin/formatter/line_filter.rb +0 -26
  181. data/lib/gherkin/formatter/model.rb +0 -281
  182. data/lib/gherkin/formatter/pretty_formatter.rb +0 -245
  183. data/lib/gherkin/formatter/regexp_filter.rb +0 -21
  184. data/lib/gherkin/formatter/step_printer.rb +0 -21
  185. data/lib/gherkin/formatter/tag_count_formatter.rb +0 -47
  186. data/lib/gherkin/formatter/tag_filter.rb +0 -19
  187. data/lib/gherkin/i18n.json +0 -786
  188. data/lib/gherkin/i18n.rb +0 -176
  189. data/lib/gherkin/json_parser.rb +0 -177
  190. data/lib/gherkin/lexer/ar.rb +0 -1170
  191. data/lib/gherkin/lexer/bg.rb +0 -1382
  192. data/lib/gherkin/lexer/bm.rb +0 -1250
  193. data/lib/gherkin/lexer/ca.rb +0 -1310
  194. data/lib/gherkin/lexer/cs.rb +0 -1246
  195. data/lib/gherkin/lexer/cy_gb.rb +0 -1032
  196. data/lib/gherkin/lexer/da.rb +0 -1048
  197. data/lib/gherkin/lexer/de.rb +0 -1166
  198. data/lib/gherkin/lexer/el.rb +0 -1628
  199. data/lib/gherkin/lexer/en.rb +0 -1156
  200. data/lib/gherkin/lexer/en_au.rb +0 -1486
  201. data/lib/gherkin/lexer/en_lol.rb +0 -934
  202. data/lib/gherkin/lexer/en_old.rb +0 -1037
  203. data/lib/gherkin/lexer/en_pirate.rb +0 -1210
  204. data/lib/gherkin/lexer/en_scouse.rb +0 -1362
  205. data/lib/gherkin/lexer/en_tx.rb +0 -1016
  206. data/lib/gherkin/lexer/encoding.rb +0 -41
  207. data/lib/gherkin/lexer/eo.rb +0 -995
  208. data/lib/gherkin/lexer/es.rb +0 -1140
  209. data/lib/gherkin/lexer/et.rb +0 -990
  210. data/lib/gherkin/lexer/fa.rb +0 -1214
  211. data/lib/gherkin/lexer/fi.rb +0 -969
  212. data/lib/gherkin/lexer/fr.rb +0 -1228
  213. data/lib/gherkin/lexer/gl.rb +0 -1117
  214. data/lib/gherkin/lexer/he.rb +0 -1118
  215. data/lib/gherkin/lexer/hi.rb +0 -1559
  216. data/lib/gherkin/lexer/hr.rb +0 -1066
  217. data/lib/gherkin/lexer/hu.rb +0 -1118
  218. data/lib/gherkin/lexer/i18n_lexer.rb +0 -48
  219. data/lib/gherkin/lexer/id.rb +0 -963
  220. data/lib/gherkin/lexer/is.rb +0 -1120
  221. data/lib/gherkin/lexer/it.rb +0 -1086
  222. data/lib/gherkin/lexer/ja.rb +0 -1418
  223. data/lib/gherkin/lexer/kn.rb +0 -1672
  224. data/lib/gherkin/lexer/ko.rb +0 -1102
  225. data/lib/gherkin/lexer/lt.rb +0 -1045
  226. data/lib/gherkin/lexer/lu.rb +0 -1132
  227. data/lib/gherkin/lexer/lv.rb +0 -1166
  228. data/lib/gherkin/lexer/nl.rb +0 -1115
  229. data/lib/gherkin/lexer/no.rb +0 -1060
  230. data/lib/gherkin/lexer/pa.rb +0 -1852
  231. data/lib/gherkin/lexer/pl.rb +0 -1457
  232. data/lib/gherkin/lexer/pt.rb +0 -1430
  233. data/lib/gherkin/lexer/ro.rb +0 -1164
  234. data/lib/gherkin/lexer/ru.rb +0 -1766
  235. data/lib/gherkin/lexer/sk.rb +0 -1452
  236. data/lib/gherkin/lexer/sr_cyrl.rb +0 -1803
  237. data/lib/gherkin/lexer/sr_latn.rb +0 -1294
  238. data/lib/gherkin/lexer/sv.rb +0 -1070
  239. data/lib/gherkin/lexer/th.rb +0 -2492
  240. data/lib/gherkin/lexer/tl.rb +0 -1726
  241. data/lib/gherkin/lexer/tr.rb +0 -1092
  242. data/lib/gherkin/lexer/tt.rb +0 -1643
  243. data/lib/gherkin/lexer/uk.rb +0 -1646
  244. data/lib/gherkin/lexer/uz.rb +0 -1376
  245. data/lib/gherkin/lexer/vi.rb +0 -1198
  246. data/lib/gherkin/lexer/zh_cn.rb +0 -1058
  247. data/lib/gherkin/lexer/zh_tw.rb +0 -1052
  248. data/lib/gherkin/listener/event.rb +0 -45
  249. data/lib/gherkin/listener/formatter_listener.rb +0 -150
  250. data/lib/gherkin/native.rb +0 -7
  251. data/lib/gherkin/native/java.rb +0 -72
  252. data/lib/gherkin/native/null.rb +0 -5
  253. data/lib/gherkin/native/therubyracer.rb +0 -41
  254. data/lib/gherkin/parser/meta.txt +0 -5
  255. data/lib/gherkin/parser/parser.rb +0 -166
  256. data/lib/gherkin/parser/root.txt +0 -11
  257. data/lib/gherkin/parser/steps.txt +0 -4
  258. data/lib/gherkin/platform.rb +0 -13
  259. data/lib/gherkin/rubify.rb +0 -31
  260. data/lib/gherkin/tag_expression.rb +0 -63
  261. data/ragel/lexer.c.rl.erb +0 -454
  262. data/ragel/lexer.java.rl.erb +0 -219
  263. data/ragel/lexer.js.rl.erb +0 -322
  264. data/ragel/lexer.rb.rl.erb +0 -179
  265. data/ragel/lexer_common.rl.erb +0 -50
  266. data/spec/gherkin/c_lexer_spec.rb +0 -22
  267. data/spec/gherkin/fixtures/1.feature +0 -8
  268. data/spec/gherkin/fixtures/comments_in_table.feature +0 -9
  269. data/spec/gherkin/fixtures/complex.feature +0 -45
  270. data/spec/gherkin/fixtures/complex.json +0 -139
  271. data/spec/gherkin/fixtures/complex_for_filtering.feature +0 -60
  272. data/spec/gherkin/fixtures/complex_with_tags.feature +0 -61
  273. data/spec/gherkin/fixtures/dos_line_endings.feature +0 -45
  274. data/spec/gherkin/fixtures/examples_with_only_header.feature +0 -14
  275. data/spec/gherkin/fixtures/hantu_pisang.feature +0 -35
  276. data/spec/gherkin/fixtures/i18n_fr.feature +0 -14
  277. data/spec/gherkin/fixtures/i18n_fr2.feature +0 -8
  278. data/spec/gherkin/fixtures/i18n_no.feature +0 -7
  279. data/spec/gherkin/fixtures/i18n_pt1.feature +0 -44
  280. data/spec/gherkin/fixtures/i18n_pt2.feature +0 -4
  281. data/spec/gherkin/fixtures/i18n_pt3.feature +0 -4
  282. data/spec/gherkin/fixtures/i18n_pt4.feature +0 -4
  283. data/spec/gherkin/fixtures/i18n_zh-CN.feature +0 -9
  284. data/spec/gherkin/fixtures/iso-8859-1.feature +0 -6
  285. data/spec/gherkin/fixtures/issue_145.feature +0 -22
  286. data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +0 -13
  287. data/spec/gherkin/fixtures/scenario_without_steps.feature +0 -5
  288. data/spec/gherkin/fixtures/simple_with_comments.feature +0 -7
  289. data/spec/gherkin/fixtures/simple_with_tags.feature +0 -11
  290. data/spec/gherkin/fixtures/with_bom.feature +0 -3
  291. data/spec/gherkin/fixtures/with_bom_and_language_spec.feature +0 -4
  292. data/spec/gherkin/formatter/ansi_escapes_spec.rb +0 -32
  293. data/spec/gherkin/formatter/filter_formatter_spec.rb +0 -204
  294. data/spec/gherkin/formatter/json_formatter_spec.rb +0 -179
  295. data/spec/gherkin/formatter/model_spec.rb +0 -28
  296. data/spec/gherkin/formatter/pretty_formatter_spec.rb +0 -184
  297. data/spec/gherkin/formatter/spaces.feature +0 -9
  298. data/spec/gherkin/formatter/step_printer_spec.rb +0 -55
  299. data/spec/gherkin/formatter/tabs.feature +0 -9
  300. data/spec/gherkin/formatter/tag_count_formatter_spec.rb +0 -30
  301. data/spec/gherkin/i18n_spec.rb +0 -256
  302. data/spec/gherkin/java_lexer_spec.rb +0 -20
  303. data/spec/gherkin/json_parser_spec.rb +0 -165
  304. data/spec/gherkin/lexer/i18n_lexer_spec.rb +0 -65
  305. data/spec/gherkin/native_lexer_spec.rb +0 -29
  306. data/spec/gherkin/parser/parser_spec.rb +0 -16
  307. data/spec/gherkin/rubify_spec.rb +0 -23
  308. data/spec/gherkin/sexp_recorder.rb +0 -59
  309. data/spec/gherkin/shared/doc_string_group.rb +0 -161
  310. data/spec/gherkin/shared/encoding_group.rb +0 -48
  311. data/spec/gherkin/shared/lexer_group.rb +0 -589
  312. data/spec/gherkin/shared/row_group.rb +0 -123
  313. data/spec/gherkin/shared/tags_group.rb +0 -52
  314. data/spec/gherkin/tag_expression_spec.rb +0 -146
  315. data/spec/spec_helper.rb +0 -94
  316. data/tasks/apidoc.rake +0 -32
  317. data/tasks/bench.rake +0 -184
  318. data/tasks/bench/feature_builder.rb +0 -49
  319. data/tasks/bench/null_listener.rb +0 -4
  320. data/tasks/compile.rake +0 -83
  321. data/tasks/cucumber.rake +0 -23
  322. data/tasks/gems.rake +0 -46
  323. data/tasks/ikvm.rake +0 -126
  324. data/tasks/ragel_task.rb +0 -124
  325. data/tasks/release.rake +0 -34
  326. data/tasks/rspec.rake +0 -6
  327. data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
  328. data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
  329. data/tasks/yard/default/layout/html/footer.erb +0 -5
  330. data/tasks/yard/default/layout/html/index.erb +0 -1
  331. data/tasks/yard/default/layout/html/layout.erb +0 -25
  332. data/tasks/yard/default/layout/html/logo.erb +0 -1
  333. data/tasks/yard/default/layout/html/setup.rb +0 -4
@@ -1,1058 +0,0 @@
1
-
2
- # line 1 "ragel/i18n/zh_cn.rb.rl"
3
- require 'gherkin/native'
4
-
5
- module Gherkin
6
- module Lexer
7
- class Zh_cn #:nodoc:
8
- native_impl('gherkin')
9
-
10
-
11
- # line 125 "ragel/i18n/zh_cn.rb.rl"
12
-
13
-
14
- def initialize(listener)
15
- @listener = listener
16
-
17
- # Initialize ivars to avoid warnings
18
- @keyword = nil
19
-
20
- # line 21 "lib/gherkin/lexer/zh_cn.rb"
21
- class << self
22
- attr_accessor :_lexer_actions
23
- private :_lexer_actions, :_lexer_actions=
24
- end
25
- self._lexer_actions = [
26
- 0, 1, 0, 1, 1, 1, 2, 1,
27
- 3, 1, 4, 1, 5, 1, 6, 1,
28
- 7, 1, 8, 1, 9, 1, 10, 1,
29
- 11, 1, 12, 1, 13, 1, 16, 1,
30
- 17, 1, 18, 1, 19, 1, 20, 1,
31
- 21, 1, 22, 1, 23, 2, 2, 18,
32
- 2, 3, 4, 2, 13, 0, 2, 14,
33
- 15, 2, 17, 0, 2, 17, 1, 2,
34
- 17, 16, 2, 17, 19, 2, 18, 6,
35
- 2, 18, 7, 2, 18, 8, 2, 18,
36
- 9, 2, 18, 10, 2, 18, 16, 2,
37
- 20, 21, 2, 22, 0, 2, 22, 1,
38
- 2, 22, 16, 2, 22, 19, 3, 4,
39
- 14, 15, 3, 5, 14, 15, 3, 11,
40
- 14, 15, 3, 12, 14, 15, 3, 13,
41
- 14, 15, 3, 14, 15, 18, 3, 17,
42
- 0, 11, 3, 17, 14, 15, 4, 2,
43
- 14, 15, 18, 4, 3, 4, 14, 15,
44
- 4, 17, 0, 14, 15, 5, 17, 0,
45
- 11, 14, 15
46
- ]
47
-
48
- class << self
49
- attr_accessor :_lexer_key_offsets
50
- private :_lexer_key_offsets, :_lexer_key_offsets=
51
- end
52
- self._lexer_key_offsets = [
53
- 0, 0, 15, 17, 18, 19, 20, 21,
54
- 23, 25, 39, 46, 47, 49, 51, 52,
55
- 53, 54, 55, 56, 57, 58, 59, 61,
56
- 62, 63, 64, 65, 66, 67, 68, 69,
57
- 81, 83, 85, 87, 89, 91, 105, 107,
58
- 108, 109, 110, 111, 112, 113, 114, 115,
59
- 116, 117, 118, 130, 132, 134, 136, 138,
60
- 140, 148, 150, 153, 156, 158, 160, 162,
61
- 164, 166, 168, 170, 172, 175, 177, 179,
62
- 181, 183, 185, 187, 189, 191, 193, 195,
63
- 197, 199, 201, 203, 205, 207, 209, 211,
64
- 213, 215, 217, 219, 221, 223, 225, 227,
65
- 229, 231, 233, 235, 237, 239, 241, 243,
66
- 245, 247, 249, 251, 253, 255, 257, 259,
67
- 261, 263, 265, 266, 267, 268, 269, 270,
68
- 271, 272, 274, 276, 281, 286, 291, 296,
69
- 300, 304, 306, 307, 308, 309, 310, 311,
70
- 312, 313, 314, 315, 316, 317, 318, 319,
71
- 320, 321, 322, 327, 334, 339, 343, 349,
72
- 352, 354, 360, 374, 382, 384, 387, 390,
73
- 392, 394, 396, 398, 400, 402, 404, 406,
74
- 408, 410, 412, 414, 416, 418, 420, 422,
75
- 424, 426, 428, 430, 432, 434, 436, 438,
76
- 440, 442, 444, 446, 448, 450, 452, 454,
77
- 456, 458, 460, 462, 464, 466, 468, 470,
78
- 472, 474, 476, 478, 480, 482, 484, 486,
79
- 487, 488, 500, 502, 504, 506, 508, 510,
80
- 518, 520, 523, 526, 528, 530, 532, 534,
81
- 536, 538, 540, 542, 545, 547, 549, 551,
82
- 553, 555, 557, 559, 561, 563, 565, 567,
83
- 569, 571, 573, 575, 577, 579, 581, 583,
84
- 585, 587, 589, 591, 594, 596, 598, 600,
85
- 602, 604, 606, 608, 610, 612, 614, 616,
86
- 618, 620, 622, 624, 626, 628, 630, 632,
87
- 634, 636, 638, 640, 642, 644, 645, 646,
88
- 647, 648, 649, 650, 651, 661, 663, 665,
89
- 667, 669, 671, 673, 677, 679, 681, 683,
90
- 685, 688, 690, 692, 694, 696, 698, 700,
91
- 702, 704, 706, 708, 710, 712, 714, 716,
92
- 718, 720, 722, 724, 726, 728, 730, 732,
93
- 734, 736, 738, 740, 742, 744, 746, 748,
94
- 750, 752, 753, 754, 755, 756, 757, 758,
95
- 759, 760, 761, 762, 763, 764, 765, 766,
96
- 767, 768, 769, 776, 778, 780, 782, 784,
97
- 786, 788, 789, 790
98
- ]
99
-
100
- class << self
101
- attr_accessor :_lexer_trans_keys
102
- private :_lexer_trans_keys, :_lexer_trans_keys=
103
- end
104
- self._lexer_trans_keys = [
105
- -28, -27, -24, -23, -17, 10, 32, 34,
106
- 35, 37, 42, 64, 124, 9, 13, -67,
107
- -66, -122, -26, -104, -81, 10, 13, 10,
108
- 13, -28, -27, -24, -23, 10, 32, 34,
109
- 35, 37, 42, 64, 124, 9, 13, -127,
110
- -119, -118, -112, -100, -71, -67, -121, -27,
111
- -24, -90, -82, -126, -102, -82, -66, -89,
112
- -26, -100, -84, -27, 58, -92, -89, -25,
113
- -70, -78, 58, 10, 10, -28, -27, -24,
114
- -23, 10, 32, 35, 37, 42, 64, 9,
115
- 13, -67, 10, -122, 10, -26, 10, -104,
116
- 10, -81, 10, -28, -27, -24, -23, 10,
117
- 32, 34, 35, 37, 42, 64, 124, 9,
118
- 13, -128, -125, -116, -28, -72, -108, -116,
119
- -26, -103, -81, 58, 10, 10, -28, -27,
120
- -24, -23, 10, 32, 35, 37, 42, 64,
121
- 9, 13, -67, 10, -122, 10, -26, 10,
122
- -104, 10, -81, 10, -127, -119, -118, -112,
123
- -100, -71, -67, 10, -121, 10, -27, -24,
124
- 10, -90, -82, 10, -126, 10, -102, 10,
125
- -82, 10, -66, 10, -89, 10, -26, 10,
126
- -100, 10, -84, 10, -27, 10, 58, -92,
127
- 10, -89, 10, -25, 10, -70, 10, -78,
128
- 10, 10, 58, -97, 10, -24, 10, -125,
129
- 10, -67, 10, -116, 10, -26, 10, -105,
130
- 10, -74, 10, -70, 10, -26, 10, -103,
131
- 10, -81, 10, -74, 10, -28, 10, -72,
132
- 10, -108, 10, -109, 10, -128, 10, -116,
133
- 10, -126, 10, -93, 10, -28, 10, -71,
134
- 10, -120, 10, 10, 95, 10, 70, 10,
135
- 69, 10, 65, 10, 84, 10, 85, 10,
136
- 82, 10, 69, 10, 95, 10, 69, 10,
137
- 78, 10, 68, 10, 95, 10, 37, 10,
138
- 32, -126, -93, -28, -71, -120, 34, 34,
139
- 10, 13, 10, 13, 10, 32, 34, 9,
140
- 13, 10, 32, 34, 9, 13, 10, 32,
141
- 34, 9, 13, 10, 32, 34, 9, 13,
142
- 10, 32, 9, 13, 10, 32, 9, 13,
143
- 10, 13, 10, 95, 70, 69, 65, 84,
144
- 85, 82, 69, 95, 69, 78, 68, 95,
145
- 37, 32, 13, 32, 64, 9, 10, 9,
146
- 10, 13, 32, 64, 11, 12, 10, 32,
147
- 64, 9, 13, 32, 124, 9, 13, 10,
148
- 32, 92, 124, 9, 13, 10, 92, 124,
149
- 10, 92, 10, 32, 92, 124, 9, 13,
150
- -28, -27, -24, -23, 10, 32, 34, 35,
151
- 37, 42, 64, 124, 9, 13, -127, -119,
152
- -118, -112, -100, -71, -67, 10, -121, 10,
153
- -27, -24, 10, -90, -82, 10, -126, 10,
154
- -102, 10, -82, 10, -66, 10, -89, 10,
155
- -26, 10, -100, 10, -84, 10, 10, 58,
156
- -97, 10, -24, 10, -125, 10, -67, 10,
157
- -116, 10, -26, 10, -105, 10, -74, 10,
158
- -70, 10, -26, 10, -103, 10, -81, 10,
159
- -74, 10, -28, 10, -72, 10, -108, 10,
160
- -109, 10, -128, 10, -116, 10, -126, 10,
161
- -93, 10, -28, 10, -71, 10, -120, 10,
162
- 10, 95, 10, 70, 10, 69, 10, 65,
163
- 10, 84, 10, 85, 10, 82, 10, 69,
164
- 10, 95, 10, 69, 10, 78, 10, 68,
165
- 10, 95, 10, 37, 10, 32, 10, 10,
166
- -28, -27, -24, -23, 10, 32, 35, 37,
167
- 42, 64, 9, 13, -67, 10, -122, 10,
168
- -26, 10, -104, 10, -81, 10, -127, -119,
169
- -118, -112, -100, -71, -67, 10, -121, 10,
170
- -27, -24, 10, -90, -82, 10, -126, 10,
171
- -102, 10, -82, 10, -66, 10, -89, 10,
172
- -26, 10, -100, 10, -84, 10, -27, 10,
173
- 58, -92, 10, -89, 10, -25, 10, -70,
174
- 10, -78, 10, 10, 58, -97, 10, -24,
175
- 10, -125, 10, -67, 10, -116, 10, -26,
176
- 10, -105, 10, -74, 10, -70, 10, -26,
177
- 10, -103, 10, -81, 10, -74, 10, -28,
178
- 10, -72, 10, -108, 10, -109, 10, -128,
179
- -125, 10, -116, 10, -116, 10, -26, 10,
180
- -103, 10, -81, 10, -126, 10, -93, 10,
181
- -28, 10, -71, 10, -120, 10, 10, 95,
182
- 10, 70, 10, 69, 10, 65, 10, 84,
183
- 10, 85, 10, 82, 10, 69, 10, 95,
184
- 10, 69, 10, 78, 10, 68, 10, 95,
185
- 10, 37, 10, 32, -97, -24, -125, -67,
186
- 58, 10, 10, -28, -27, -24, 10, 32,
187
- 35, 37, 64, 9, 13, -66, 10, -117,
188
- 10, -27, 10, -83, 10, -112, 10, 10,
189
- 58, -119, -118, -100, 10, -89, 10, -26,
190
- 10, -100, 10, -84, 10, -27, 10, 58,
191
- -92, 10, -89, 10, -25, 10, -70, 10,
192
- -78, 10, -97, 10, -24, 10, -125, 10,
193
- -67, 10, -70, 10, -26, 10, -103, 10,
194
- -81, 10, -125, 10, -116, 10, -26, 10,
195
- -103, 10, -81, 10, 10, 95, 10, 70,
196
- 10, 69, 10, 65, 10, 84, 10, 85,
197
- 10, 82, 10, 69, 10, 95, 10, 69,
198
- 10, 78, 10, 68, 10, 95, 10, 37,
199
- -116, -26, -105, -74, -70, -26, -103, -81,
200
- -74, -109, -117, -27, -83, -112, 58, 10,
201
- 10, -27, 10, 32, 35, 124, 9, 13,
202
- -118, 10, -97, 10, -24, 10, -125, 10,
203
- -67, 10, 10, 58, -69, -65, 0
204
- ]
205
-
206
- class << self
207
- attr_accessor :_lexer_single_lengths
208
- private :_lexer_single_lengths, :_lexer_single_lengths=
209
- end
210
- self._lexer_single_lengths = [
211
- 0, 13, 2, 1, 1, 1, 1, 2,
212
- 2, 12, 7, 1, 2, 2, 1, 1,
213
- 1, 1, 1, 1, 1, 1, 2, 1,
214
- 1, 1, 1, 1, 1, 1, 1, 10,
215
- 2, 2, 2, 2, 2, 12, 2, 1,
216
- 1, 1, 1, 1, 1, 1, 1, 1,
217
- 1, 1, 10, 2, 2, 2, 2, 2,
218
- 8, 2, 3, 3, 2, 2, 2, 2,
219
- 2, 2, 2, 2, 3, 2, 2, 2,
220
- 2, 2, 2, 2, 2, 2, 2, 2,
221
- 2, 2, 2, 2, 2, 2, 2, 2,
222
- 2, 2, 2, 2, 2, 2, 2, 2,
223
- 2, 2, 2, 2, 2, 2, 2, 2,
224
- 2, 2, 2, 2, 2, 2, 2, 2,
225
- 2, 2, 1, 1, 1, 1, 1, 1,
226
- 1, 2, 2, 3, 3, 3, 3, 2,
227
- 2, 2, 1, 1, 1, 1, 1, 1,
228
- 1, 1, 1, 1, 1, 1, 1, 1,
229
- 1, 1, 3, 5, 3, 2, 4, 3,
230
- 2, 4, 12, 8, 2, 3, 3, 2,
231
- 2, 2, 2, 2, 2, 2, 2, 2,
232
- 2, 2, 2, 2, 2, 2, 2, 2,
233
- 2, 2, 2, 2, 2, 2, 2, 2,
234
- 2, 2, 2, 2, 2, 2, 2, 2,
235
- 2, 2, 2, 2, 2, 2, 2, 2,
236
- 2, 2, 2, 2, 2, 2, 2, 1,
237
- 1, 10, 2, 2, 2, 2, 2, 8,
238
- 2, 3, 3, 2, 2, 2, 2, 2,
239
- 2, 2, 2, 3, 2, 2, 2, 2,
240
- 2, 2, 2, 2, 2, 2, 2, 2,
241
- 2, 2, 2, 2, 2, 2, 2, 2,
242
- 2, 2, 2, 3, 2, 2, 2, 2,
243
- 2, 2, 2, 2, 2, 2, 2, 2,
244
- 2, 2, 2, 2, 2, 2, 2, 2,
245
- 2, 2, 2, 2, 2, 1, 1, 1,
246
- 1, 1, 1, 1, 8, 2, 2, 2,
247
- 2, 2, 2, 4, 2, 2, 2, 2,
248
- 3, 2, 2, 2, 2, 2, 2, 2,
249
- 2, 2, 2, 2, 2, 2, 2, 2,
250
- 2, 2, 2, 2, 2, 2, 2, 2,
251
- 2, 2, 2, 2, 2, 2, 2, 2,
252
- 2, 1, 1, 1, 1, 1, 1, 1,
253
- 1, 1, 1, 1, 1, 1, 1, 1,
254
- 1, 1, 5, 2, 2, 2, 2, 2,
255
- 2, 1, 1, 0
256
- ]
257
-
258
- class << self
259
- attr_accessor :_lexer_range_lengths
260
- private :_lexer_range_lengths, :_lexer_range_lengths=
261
- end
262
- self._lexer_range_lengths = [
263
- 0, 1, 0, 0, 0, 0, 0, 0,
264
- 0, 1, 0, 0, 0, 0, 0, 0,
265
- 0, 0, 0, 0, 0, 0, 0, 0,
266
- 0, 0, 0, 0, 0, 0, 0, 1,
267
- 0, 0, 0, 0, 0, 1, 0, 0,
268
- 0, 0, 0, 0, 0, 0, 0, 0,
269
- 0, 0, 1, 0, 0, 0, 0, 0,
270
- 0, 0, 0, 0, 0, 0, 0, 0,
271
- 0, 0, 0, 0, 0, 0, 0, 0,
272
- 0, 0, 0, 0, 0, 0, 0, 0,
273
- 0, 0, 0, 0, 0, 0, 0, 0,
274
- 0, 0, 0, 0, 0, 0, 0, 0,
275
- 0, 0, 0, 0, 0, 0, 0, 0,
276
- 0, 0, 0, 0, 0, 0, 0, 0,
277
- 0, 0, 0, 0, 0, 0, 0, 0,
278
- 0, 0, 0, 1, 1, 1, 1, 1,
279
- 1, 0, 0, 0, 0, 0, 0, 0,
280
- 0, 0, 0, 0, 0, 0, 0, 0,
281
- 0, 0, 1, 1, 1, 1, 1, 0,
282
- 0, 1, 1, 0, 0, 0, 0, 0,
283
- 0, 0, 0, 0, 0, 0, 0, 0,
284
- 0, 0, 0, 0, 0, 0, 0, 0,
285
- 0, 0, 0, 0, 0, 0, 0, 0,
286
- 0, 0, 0, 0, 0, 0, 0, 0,
287
- 0, 0, 0, 0, 0, 0, 0, 0,
288
- 0, 0, 0, 0, 0, 0, 0, 0,
289
- 0, 1, 0, 0, 0, 0, 0, 0,
290
- 0, 0, 0, 0, 0, 0, 0, 0,
291
- 0, 0, 0, 0, 0, 0, 0, 0,
292
- 0, 0, 0, 0, 0, 0, 0, 0,
293
- 0, 0, 0, 0, 0, 0, 0, 0,
294
- 0, 0, 0, 0, 0, 0, 0, 0,
295
- 0, 0, 0, 0, 0, 0, 0, 0,
296
- 0, 0, 0, 0, 0, 0, 0, 0,
297
- 0, 0, 0, 0, 0, 0, 0, 0,
298
- 0, 0, 0, 0, 1, 0, 0, 0,
299
- 0, 0, 0, 0, 0, 0, 0, 0,
300
- 0, 0, 0, 0, 0, 0, 0, 0,
301
- 0, 0, 0, 0, 0, 0, 0, 0,
302
- 0, 0, 0, 0, 0, 0, 0, 0,
303
- 0, 0, 0, 0, 0, 0, 0, 0,
304
- 0, 0, 0, 0, 0, 0, 0, 0,
305
- 0, 0, 0, 0, 0, 0, 0, 0,
306
- 0, 0, 1, 0, 0, 0, 0, 0,
307
- 0, 0, 0, 0
308
- ]
309
-
310
- class << self
311
- attr_accessor :_lexer_index_offsets
312
- private :_lexer_index_offsets, :_lexer_index_offsets=
313
- end
314
- self._lexer_index_offsets = [
315
- 0, 0, 15, 18, 20, 22, 24, 26,
316
- 29, 32, 46, 54, 56, 59, 62, 64,
317
- 66, 68, 70, 72, 74, 76, 78, 81,
318
- 83, 85, 87, 89, 91, 93, 95, 97,
319
- 109, 112, 115, 118, 121, 124, 138, 141,
320
- 143, 145, 147, 149, 151, 153, 155, 157,
321
- 159, 161, 163, 175, 178, 181, 184, 187,
322
- 190, 199, 202, 206, 210, 213, 216, 219,
323
- 222, 225, 228, 231, 234, 238, 241, 244,
324
- 247, 250, 253, 256, 259, 262, 265, 268,
325
- 271, 274, 277, 280, 283, 286, 289, 292,
326
- 295, 298, 301, 304, 307, 310, 313, 316,
327
- 319, 322, 325, 328, 331, 334, 337, 340,
328
- 343, 346, 349, 352, 355, 358, 361, 364,
329
- 367, 370, 373, 375, 377, 379, 381, 383,
330
- 385, 387, 390, 393, 398, 403, 408, 413,
331
- 417, 421, 424, 426, 428, 430, 432, 434,
332
- 436, 438, 440, 442, 444, 446, 448, 450,
333
- 452, 454, 456, 461, 468, 473, 477, 483,
334
- 487, 490, 496, 510, 519, 522, 526, 530,
335
- 533, 536, 539, 542, 545, 548, 551, 554,
336
- 557, 560, 563, 566, 569, 572, 575, 578,
337
- 581, 584, 587, 590, 593, 596, 599, 602,
338
- 605, 608, 611, 614, 617, 620, 623, 626,
339
- 629, 632, 635, 638, 641, 644, 647, 650,
340
- 653, 656, 659, 662, 665, 668, 671, 674,
341
- 676, 678, 690, 693, 696, 699, 702, 705,
342
- 714, 717, 721, 725, 728, 731, 734, 737,
343
- 740, 743, 746, 749, 753, 756, 759, 762,
344
- 765, 768, 771, 774, 777, 780, 783, 786,
345
- 789, 792, 795, 798, 801, 804, 807, 810,
346
- 813, 816, 819, 822, 826, 829, 832, 835,
347
- 838, 841, 844, 847, 850, 853, 856, 859,
348
- 862, 865, 868, 871, 874, 877, 880, 883,
349
- 886, 889, 892, 895, 898, 901, 903, 905,
350
- 907, 909, 911, 913, 915, 925, 928, 931,
351
- 934, 937, 940, 943, 948, 951, 954, 957,
352
- 960, 964, 967, 970, 973, 976, 979, 982,
353
- 985, 988, 991, 994, 997, 1000, 1003, 1006,
354
- 1009, 1012, 1015, 1018, 1021, 1024, 1027, 1030,
355
- 1033, 1036, 1039, 1042, 1045, 1048, 1051, 1054,
356
- 1057, 1060, 1062, 1064, 1066, 1068, 1070, 1072,
357
- 1074, 1076, 1078, 1080, 1082, 1084, 1086, 1088,
358
- 1090, 1092, 1094, 1101, 1104, 1107, 1110, 1113,
359
- 1116, 1119, 1121, 1123
360
- ]
361
-
362
- class << self
363
- attr_accessor :_lexer_indicies
364
- private :_lexer_indicies, :_lexer_indicies=
365
- end
366
- self._lexer_indicies = [
367
- 1, 2, 3, 4, 5, 7, 6, 8,
368
- 9, 10, 11, 12, 13, 6, 0, 14,
369
- 15, 0, 16, 0, 17, 0, 18, 0,
370
- 19, 0, 21, 22, 20, 24, 25, 23,
371
- 1, 2, 3, 4, 7, 6, 8, 9,
372
- 10, 11, 12, 13, 6, 0, 26, 27,
373
- 28, 29, 30, 31, 32, 0, 33, 0,
374
- 34, 35, 0, 36, 37, 0, 19, 0,
375
- 19, 0, 38, 0, 19, 0, 39, 0,
376
- 40, 0, 41, 0, 42, 0, 43, 44,
377
- 0, 45, 0, 46, 0, 47, 0, 48,
378
- 0, 49, 0, 50, 0, 52, 51, 54,
379
- 53, 55, 56, 57, 58, 54, 59, 60,
380
- 61, 62, 60, 59, 53, 63, 54, 53,
381
- 64, 54, 53, 65, 54, 53, 66, 54,
382
- 53, 67, 54, 53, 68, 69, 70, 71,
383
- 73, 72, 74, 75, 76, 77, 78, 79,
384
- 72, 0, 80, 81, 0, 82, 0, 83,
385
- 0, 84, 0, 19, 0, 85, 0, 86,
386
- 0, 87, 0, 88, 0, 89, 0, 91,
387
- 90, 93, 92, 94, 95, 96, 97, 93,
388
- 98, 99, 100, 101, 99, 98, 92, 102,
389
- 93, 92, 103, 93, 92, 104, 93, 92,
390
- 105, 93, 92, 106, 93, 92, 107, 108,
391
- 109, 110, 111, 112, 113, 93, 92, 114,
392
- 93, 92, 115, 116, 93, 92, 117, 118,
393
- 93, 92, 106, 93, 92, 106, 93, 92,
394
- 119, 93, 92, 106, 93, 92, 120, 93,
395
- 92, 121, 93, 92, 122, 93, 92, 123,
396
- 93, 92, 124, 93, 106, 92, 125, 93,
397
- 92, 126, 93, 92, 127, 93, 92, 128,
398
- 93, 92, 129, 93, 92, 93, 106, 92,
399
- 130, 93, 92, 131, 93, 92, 132, 93,
400
- 92, 129, 93, 92, 133, 93, 92, 134,
401
- 93, 92, 135, 93, 92, 106, 93, 92,
402
- 136, 93, 92, 137, 93, 92, 138, 93,
403
- 92, 123, 93, 92, 139, 93, 92, 140,
404
- 93, 92, 141, 93, 92, 106, 93, 92,
405
- 106, 93, 92, 142, 93, 92, 139, 93,
406
- 92, 143, 93, 92, 144, 93, 92, 145,
407
- 93, 92, 146, 93, 92, 106, 93, 92,
408
- 93, 147, 92, 93, 148, 92, 93, 149,
409
- 92, 93, 150, 92, 93, 151, 92, 93,
410
- 152, 92, 93, 153, 92, 93, 154, 92,
411
- 93, 155, 92, 93, 156, 92, 93, 157,
412
- 92, 93, 158, 92, 93, 159, 92, 93,
413
- 160, 92, 93, 106, 92, 161, 0, 162,
414
- 0, 163, 0, 164, 0, 19, 0, 165,
415
- 0, 166, 0, 168, 169, 167, 171, 172,
416
- 170, 175, 174, 176, 174, 173, 179, 178,
417
- 180, 178, 177, 179, 178, 181, 178, 177,
418
- 179, 178, 182, 178, 177, 184, 183, 183,
419
- 0, 7, 185, 185, 0, 187, 188, 186,
420
- 7, 0, 189, 0, 190, 0, 191, 0,
421
- 192, 0, 193, 0, 194, 0, 195, 0,
422
- 196, 0, 197, 0, 198, 0, 199, 0,
423
- 200, 0, 201, 0, 202, 0, 19, 0,
424
- 0, 0, 0, 0, 203, 204, 205, 204,
425
- 204, 207, 206, 203, 7, 208, 12, 208,
426
- 0, 209, 210, 209, 0, 213, 212, 214,
427
- 215, 212, 211, 0, 217, 218, 216, 0,
428
- 217, 216, 213, 219, 217, 218, 219, 216,
429
- 220, 221, 222, 223, 213, 224, 225, 226,
430
- 227, 228, 229, 230, 224, 0, 231, 232,
431
- 233, 234, 235, 236, 237, 54, 53, 238,
432
- 54, 53, 239, 240, 54, 53, 241, 242,
433
- 54, 53, 67, 54, 53, 67, 54, 53,
434
- 243, 54, 53, 67, 54, 53, 244, 54,
435
- 53, 245, 54, 53, 246, 54, 53, 247,
436
- 54, 53, 54, 67, 53, 248, 54, 53,
437
- 249, 54, 53, 250, 54, 53, 247, 54,
438
- 53, 251, 54, 53, 252, 54, 53, 253,
439
- 54, 53, 67, 54, 53, 254, 54, 53,
440
- 255, 54, 53, 256, 54, 53, 247, 54,
441
- 53, 257, 54, 53, 258, 54, 53, 259,
442
- 54, 53, 67, 54, 53, 67, 54, 53,
443
- 260, 54, 53, 257, 54, 53, 261, 54,
444
- 53, 262, 54, 53, 263, 54, 53, 264,
445
- 54, 53, 67, 54, 53, 54, 265, 53,
446
- 54, 266, 53, 54, 267, 53, 54, 268,
447
- 53, 54, 269, 53, 54, 270, 53, 54,
448
- 271, 53, 54, 272, 53, 54, 273, 53,
449
- 54, 274, 53, 54, 275, 53, 54, 276,
450
- 53, 54, 277, 53, 54, 278, 53, 54,
451
- 67, 53, 280, 279, 282, 281, 283, 284,
452
- 285, 286, 282, 287, 288, 289, 290, 288,
453
- 287, 281, 291, 282, 281, 292, 282, 281,
454
- 293, 282, 281, 294, 282, 281, 295, 282,
455
- 281, 296, 297, 298, 299, 300, 301, 302,
456
- 282, 281, 303, 282, 281, 304, 305, 282,
457
- 281, 306, 307, 282, 281, 295, 282, 281,
458
- 295, 282, 281, 308, 282, 281, 295, 282,
459
- 281, 309, 282, 281, 310, 282, 281, 311,
460
- 282, 281, 312, 282, 281, 313, 282, 295,
461
- 281, 314, 282, 281, 315, 282, 281, 316,
462
- 282, 281, 317, 282, 281, 318, 282, 281,
463
- 282, 295, 281, 319, 282, 281, 320, 282,
464
- 281, 321, 282, 281, 318, 282, 281, 322,
465
- 282, 281, 323, 282, 281, 324, 282, 281,
466
- 295, 282, 281, 325, 282, 281, 326, 282,
467
- 281, 327, 282, 281, 312, 282, 281, 328,
468
- 282, 281, 329, 282, 281, 330, 282, 281,
469
- 295, 282, 281, 295, 282, 281, 331, 332,
470
- 282, 281, 328, 282, 281, 333, 282, 281,
471
- 334, 282, 281, 335, 282, 281, 318, 282,
472
- 281, 336, 282, 281, 337, 282, 281, 338,
473
- 282, 281, 339, 282, 281, 295, 282, 281,
474
- 282, 340, 281, 282, 341, 281, 282, 342,
475
- 281, 282, 343, 281, 282, 344, 281, 282,
476
- 345, 281, 282, 346, 281, 282, 347, 281,
477
- 282, 348, 281, 282, 349, 281, 282, 350,
478
- 281, 282, 351, 281, 282, 352, 281, 282,
479
- 353, 281, 282, 295, 281, 354, 0, 355,
480
- 0, 356, 0, 357, 0, 358, 0, 360,
481
- 359, 362, 361, 363, 364, 365, 362, 366,
482
- 367, 368, 367, 366, 361, 369, 362, 361,
483
- 370, 362, 361, 371, 362, 361, 372, 362,
484
- 361, 373, 362, 361, 362, 374, 361, 375,
485
- 376, 377, 362, 361, 378, 362, 361, 379,
486
- 362, 361, 380, 362, 361, 381, 362, 361,
487
- 382, 362, 374, 361, 383, 362, 361, 384,
488
- 362, 361, 385, 362, 361, 386, 362, 361,
489
- 373, 362, 361, 387, 362, 361, 388, 362,
490
- 361, 389, 362, 361, 373, 362, 361, 390,
491
- 362, 361, 391, 362, 361, 392, 362, 361,
492
- 381, 362, 361, 393, 362, 361, 394, 362,
493
- 361, 395, 362, 361, 396, 362, 361, 373,
494
- 362, 361, 362, 397, 361, 362, 398, 361,
495
- 362, 399, 361, 362, 400, 361, 362, 401,
496
- 361, 362, 402, 361, 362, 403, 361, 362,
497
- 404, 361, 362, 405, 361, 362, 406, 361,
498
- 362, 407, 361, 362, 408, 361, 362, 409,
499
- 361, 362, 410, 361, 411, 0, 412, 0,
500
- 413, 0, 19, 0, 414, 0, 415, 0,
501
- 416, 0, 42, 0, 82, 0, 19, 0,
502
- 417, 0, 418, 0, 419, 0, 420, 0,
503
- 421, 0, 423, 422, 425, 424, 426, 425,
504
- 427, 428, 428, 427, 424, 429, 425, 424,
505
- 430, 425, 424, 431, 425, 424, 432, 425,
506
- 424, 433, 425, 424, 425, 434, 424, 435,
507
- 0, 6, 0, 436, 0
508
- ]
509
-
510
- class << self
511
- attr_accessor :_lexer_trans_targs
512
- private :_lexer_trans_targs, :_lexer_trans_targs=
513
- end
514
- self._lexer_trans_targs = [
515
- 0, 2, 10, 38, 114, 353, 9, 9,
516
- 119, 129, 131, 145, 146, 149, 3, 339,
517
- 4, 5, 6, 7, 8, 9, 130, 8,
518
- 9, 130, 11, 18, 277, 329, 333, 337,
519
- 338, 12, 13, 16, 14, 15, 17, 19,
520
- 20, 21, 22, 23, 207, 24, 25, 26,
521
- 27, 28, 29, 30, 31, 30, 31, 32,
522
- 155, 185, 187, 31, 9, 192, 206, 33,
523
- 34, 35, 36, 37, 2, 10, 38, 114,
524
- 9, 9, 119, 129, 131, 145, 146, 149,
525
- 39, 43, 40, 41, 42, 44, 45, 46,
526
- 47, 48, 49, 50, 49, 50, 51, 56,
527
- 92, 94, 50, 9, 99, 113, 52, 53,
528
- 54, 55, 37, 57, 64, 75, 79, 83,
529
- 87, 91, 58, 59, 62, 60, 61, 63,
530
- 65, 66, 67, 68, 69, 70, 71, 72,
531
- 73, 74, 76, 77, 78, 80, 81, 82,
532
- 84, 85, 86, 88, 89, 90, 93, 95,
533
- 96, 97, 98, 100, 101, 102, 103, 104,
534
- 105, 106, 107, 108, 109, 110, 111, 112,
535
- 9, 115, 116, 117, 118, 120, 121, 122,
536
- 123, 122, 122, 123, 122, 124, 124, 124,
537
- 125, 124, 124, 124, 125, 126, 127, 128,
538
- 9, 128, 129, 9, 130, 132, 133, 134,
539
- 135, 136, 137, 138, 139, 140, 141, 142,
540
- 143, 144, 355, 147, 148, 9, 147, 146,
541
- 148, 149, 150, 151, 153, 154, 152, 150,
542
- 151, 152, 150, 153, 2, 10, 38, 114,
543
- 154, 119, 129, 131, 145, 146, 149, 156,
544
- 163, 168, 172, 176, 180, 184, 157, 158,
545
- 161, 159, 160, 162, 164, 165, 166, 167,
546
- 169, 170, 171, 173, 174, 175, 177, 178,
547
- 179, 181, 182, 183, 186, 188, 189, 190,
548
- 191, 193, 194, 195, 196, 197, 198, 199,
549
- 200, 201, 202, 203, 204, 205, 9, 208,
550
- 209, 208, 209, 210, 215, 251, 257, 209,
551
- 9, 262, 276, 211, 212, 213, 214, 37,
552
- 216, 223, 234, 238, 242, 246, 250, 217,
553
- 218, 221, 219, 220, 222, 224, 225, 226,
554
- 227, 228, 229, 230, 231, 232, 233, 235,
555
- 236, 237, 239, 240, 241, 243, 244, 245,
556
- 247, 248, 249, 252, 253, 254, 255, 256,
557
- 258, 259, 260, 261, 263, 264, 265, 266,
558
- 267, 268, 269, 270, 271, 272, 273, 274,
559
- 275, 9, 278, 279, 280, 281, 282, 283,
560
- 284, 283, 284, 285, 291, 310, 284, 9,
561
- 315, 286, 287, 288, 289, 290, 37, 292,
562
- 302, 306, 293, 294, 295, 296, 297, 298,
563
- 299, 300, 301, 303, 304, 305, 307, 308,
564
- 309, 311, 312, 313, 314, 316, 317, 318,
565
- 319, 320, 321, 322, 323, 324, 325, 326,
566
- 327, 328, 9, 330, 331, 332, 334, 335,
567
- 336, 340, 341, 342, 343, 344, 345, 346,
568
- 345, 346, 347, 346, 9, 348, 349, 350,
569
- 351, 352, 37, 354, 0
570
- ]
571
-
572
- class << self
573
- attr_accessor :_lexer_trans_actions
574
- private :_lexer_trans_actions, :_lexer_trans_actions=
575
- end
576
- self._lexer_trans_actions = [
577
- 43, 29, 29, 29, 29, 0, 0, 54,
578
- 3, 1, 0, 29, 1, 35, 0, 0,
579
- 0, 0, 0, 0, 57, 149, 126, 0,
580
- 110, 23, 0, 0, 0, 0, 0, 0,
581
- 0, 0, 0, 0, 0, 0, 0, 0,
582
- 0, 0, 0, 0, 0, 0, 0, 0,
583
- 0, 0, 0, 57, 144, 0, 54, 84,
584
- 84, 84, 84, 0, 78, 33, 84, 0,
585
- 0, 0, 0, 19, 63, 63, 63, 63,
586
- 31, 130, 60, 57, 31, 63, 57, 66,
587
- 0, 0, 0, 0, 0, 0, 0, 0,
588
- 0, 0, 57, 144, 0, 54, 84, 84,
589
- 84, 84, 0, 72, 33, 84, 0, 0,
590
- 0, 0, 15, 0, 0, 0, 0, 0,
591
- 0, 0, 0, 0, 0, 0, 0, 0,
592
- 0, 0, 0, 0, 0, 0, 0, 0,
593
- 0, 0, 0, 0, 0, 0, 0, 0,
594
- 0, 0, 0, 0, 0, 0, 0, 0,
595
- 0, 0, 0, 0, 0, 0, 0, 0,
596
- 0, 0, 0, 0, 0, 0, 0, 0,
597
- 15, 0, 0, 0, 0, 0, 0, 7,
598
- 139, 48, 0, 102, 9, 5, 45, 134,
599
- 45, 0, 33, 122, 33, 33, 0, 11,
600
- 106, 0, 0, 114, 25, 0, 0, 0,
601
- 0, 0, 0, 0, 0, 0, 0, 0,
602
- 0, 0, 0, 0, 27, 118, 27, 51,
603
- 0, 0, 0, 37, 37, 54, 37, 87,
604
- 0, 0, 39, 0, 96, 96, 96, 96,
605
- 0, 93, 90, 41, 96, 90, 99, 0,
606
- 0, 0, 0, 0, 0, 0, 0, 0,
607
- 0, 0, 0, 0, 0, 0, 0, 0,
608
- 0, 0, 0, 0, 0, 0, 0, 0,
609
- 0, 0, 0, 0, 0, 0, 0, 0,
610
- 0, 0, 0, 0, 0, 0, 0, 0,
611
- 0, 0, 0, 0, 0, 0, 19, 57,
612
- 144, 0, 54, 84, 84, 84, 84, 0,
613
- 75, 33, 84, 0, 0, 0, 0, 17,
614
- 0, 0, 0, 0, 0, 0, 0, 0,
615
- 0, 0, 0, 0, 0, 0, 0, 0,
616
- 0, 0, 0, 0, 0, 0, 0, 0,
617
- 0, 0, 0, 0, 0, 0, 0, 0,
618
- 0, 0, 0, 0, 0, 0, 0, 0,
619
- 0, 0, 0, 0, 0, 0, 0, 0,
620
- 0, 0, 0, 0, 0, 0, 0, 0,
621
- 0, 17, 0, 0, 0, 0, 0, 57,
622
- 144, 0, 54, 84, 84, 84, 0, 69,
623
- 33, 0, 0, 0, 0, 0, 13, 0,
624
- 0, 0, 0, 0, 0, 0, 0, 0,
625
- 0, 0, 0, 0, 0, 0, 0, 0,
626
- 0, 0, 0, 0, 0, 0, 0, 0,
627
- 0, 0, 0, 0, 0, 0, 0, 0,
628
- 0, 0, 13, 0, 0, 0, 0, 0,
629
- 0, 0, 0, 0, 0, 0, 57, 144,
630
- 0, 54, 84, 0, 81, 0, 0, 0,
631
- 0, 0, 21, 0, 0
632
- ]
633
-
634
- class << self
635
- attr_accessor :_lexer_eof_actions
636
- private :_lexer_eof_actions, :_lexer_eof_actions=
637
- end
638
- self._lexer_eof_actions = [
639
- 0, 43, 43, 43, 43, 43, 43, 43,
640
- 43, 43, 43, 43, 43, 43, 43, 43,
641
- 43, 43, 43, 43, 43, 43, 43, 43,
642
- 43, 43, 43, 43, 43, 43, 43, 43,
643
- 43, 43, 43, 43, 43, 43, 43, 43,
644
- 43, 43, 43, 43, 43, 43, 43, 43,
645
- 43, 43, 43, 43, 43, 43, 43, 43,
646
- 43, 43, 43, 43, 43, 43, 43, 43,
647
- 43, 43, 43, 43, 43, 43, 43, 43,
648
- 43, 43, 43, 43, 43, 43, 43, 43,
649
- 43, 43, 43, 43, 43, 43, 43, 43,
650
- 43, 43, 43, 43, 43, 43, 43, 43,
651
- 43, 43, 43, 43, 43, 43, 43, 43,
652
- 43, 43, 43, 43, 43, 43, 43, 43,
653
- 43, 43, 43, 43, 43, 43, 43, 43,
654
- 43, 43, 43, 43, 43, 43, 43, 43,
655
- 43, 43, 43, 43, 43, 43, 43, 43,
656
- 43, 43, 43, 43, 43, 43, 43, 43,
657
- 43, 43, 43, 43, 43, 43, 43, 43,
658
- 43, 43, 43, 43, 43, 43, 43, 43,
659
- 43, 43, 43, 43, 43, 43, 43, 43,
660
- 43, 43, 43, 43, 43, 43, 43, 43,
661
- 43, 43, 43, 43, 43, 43, 43, 43,
662
- 43, 43, 43, 43, 43, 43, 43, 43,
663
- 43, 43, 43, 43, 43, 43, 43, 43,
664
- 43, 43, 43, 43, 43, 43, 43, 43,
665
- 43, 43, 43, 43, 43, 43, 43, 43,
666
- 43, 43, 43, 43, 43, 43, 43, 43,
667
- 43, 43, 43, 43, 43, 43, 43, 43,
668
- 43, 43, 43, 43, 43, 43, 43, 43,
669
- 43, 43, 43, 43, 43, 43, 43, 43,
670
- 43, 43, 43, 43, 43, 43, 43, 43,
671
- 43, 43, 43, 43, 43, 43, 43, 43,
672
- 43, 43, 43, 43, 43, 43, 43, 43,
673
- 43, 43, 43, 43, 43, 43, 43, 43,
674
- 43, 43, 43, 43, 43, 43, 43, 43,
675
- 43, 43, 43, 43, 43, 43, 43, 43,
676
- 43, 43, 43, 43, 43, 43, 43, 43,
677
- 43, 43, 43, 43, 43, 43, 43, 43,
678
- 43, 43, 43, 43, 43, 43, 43, 43,
679
- 43, 43, 43, 43, 43, 43, 43, 43,
680
- 43, 43, 43, 43, 43, 43, 43, 43,
681
- 43, 43, 43, 43, 43, 43, 43, 43,
682
- 43, 43, 43, 43, 43, 43, 43, 43,
683
- 43, 43, 43, 43
684
- ]
685
-
686
- class << self
687
- attr_accessor :lexer_start
688
- end
689
- self.lexer_start = 1;
690
- class << self
691
- attr_accessor :lexer_first_final
692
- end
693
- self.lexer_first_final = 355;
694
- class << self
695
- attr_accessor :lexer_error
696
- end
697
- self.lexer_error = 0;
698
-
699
- class << self
700
- attr_accessor :lexer_en_main
701
- end
702
- self.lexer_en_main = 1;
703
-
704
-
705
- # line 133 "ragel/i18n/zh_cn.rb.rl"
706
- end
707
-
708
- def scan(data)
709
- data = (data + "\n%_FEATURE_END_%").unpack("c*") # Explicit EOF simplifies things considerably
710
- eof = pe = data.length
711
-
712
- @line_number = 1
713
- @last_newline = 0
714
-
715
-
716
- # line 717 "lib/gherkin/lexer/zh_cn.rb"
717
- begin
718
- p ||= 0
719
- pe ||= data.length
720
- cs = lexer_start
721
- end
722
-
723
- # line 143 "ragel/i18n/zh_cn.rb.rl"
724
-
725
- # line 726 "lib/gherkin/lexer/zh_cn.rb"
726
- begin
727
- _klen, _trans, _keys, _acts, _nacts = nil
728
- _goto_level = 0
729
- _resume = 10
730
- _eof_trans = 15
731
- _again = 20
732
- _test_eof = 30
733
- _out = 40
734
- while true
735
- _trigger_goto = false
736
- if _goto_level <= 0
737
- if p == pe
738
- _goto_level = _test_eof
739
- next
740
- end
741
- if cs == 0
742
- _goto_level = _out
743
- next
744
- end
745
- end
746
- if _goto_level <= _resume
747
- _keys = _lexer_key_offsets[cs]
748
- _trans = _lexer_index_offsets[cs]
749
- _klen = _lexer_single_lengths[cs]
750
- _break_match = false
751
-
752
- begin
753
- if _klen > 0
754
- _lower = _keys
755
- _upper = _keys + _klen - 1
756
-
757
- loop do
758
- break if _upper < _lower
759
- _mid = _lower + ( (_upper - _lower) >> 1 )
760
-
761
- if data[p].ord < _lexer_trans_keys[_mid]
762
- _upper = _mid - 1
763
- elsif data[p].ord > _lexer_trans_keys[_mid]
764
- _lower = _mid + 1
765
- else
766
- _trans += (_mid - _keys)
767
- _break_match = true
768
- break
769
- end
770
- end # loop
771
- break if _break_match
772
- _keys += _klen
773
- _trans += _klen
774
- end
775
- _klen = _lexer_range_lengths[cs]
776
- if _klen > 0
777
- _lower = _keys
778
- _upper = _keys + (_klen << 1) - 2
779
- loop do
780
- break if _upper < _lower
781
- _mid = _lower + (((_upper-_lower) >> 1) & ~1)
782
- if data[p].ord < _lexer_trans_keys[_mid]
783
- _upper = _mid - 2
784
- elsif data[p].ord > _lexer_trans_keys[_mid+1]
785
- _lower = _mid + 2
786
- else
787
- _trans += ((_mid - _keys) >> 1)
788
- _break_match = true
789
- break
790
- end
791
- end # loop
792
- break if _break_match
793
- _trans += _klen
794
- end
795
- end while false
796
- _trans = _lexer_indicies[_trans]
797
- cs = _lexer_trans_targs[_trans]
798
- if _lexer_trans_actions[_trans] != 0
799
- _acts = _lexer_trans_actions[_trans]
800
- _nacts = _lexer_actions[_acts]
801
- _acts += 1
802
- while _nacts > 0
803
- _nacts -= 1
804
- _acts += 1
805
- case _lexer_actions[_acts - 1]
806
- when 0 then
807
- # line 11 "ragel/i18n/zh_cn.rb.rl"
808
- begin
809
-
810
- @content_start = p
811
- @current_line = @line_number
812
- @start_col = p - @last_newline - "#{@keyword}:".length
813
- end
814
- when 1 then
815
- # line 17 "ragel/i18n/zh_cn.rb.rl"
816
- begin
817
-
818
- @current_line = @line_number
819
- @start_col = p - @last_newline
820
- end
821
- when 2 then
822
- # line 22 "ragel/i18n/zh_cn.rb.rl"
823
- begin
824
-
825
- @content_start = p
826
- end
827
- when 3 then
828
- # line 26 "ragel/i18n/zh_cn.rb.rl"
829
- begin
830
-
831
- @docstring_content_type_start = p
832
- end
833
- when 4 then
834
- # line 29 "ragel/i18n/zh_cn.rb.rl"
835
- begin
836
-
837
- @docstring_content_type_end = p
838
- end
839
- when 5 then
840
- # line 33 "ragel/i18n/zh_cn.rb.rl"
841
- begin
842
-
843
- con = unindent(@start_col, utf8_pack(data[@content_start...@next_keyword_start-1]).sub(/(\r?\n)?([\t ])*\Z/, '').gsub(/\\"\\"\\"/, '"""'))
844
- con_type = utf8_pack(data[@docstring_content_type_start...@docstring_content_type_end]).strip
845
- @listener.doc_string(con_type, con, @current_line)
846
- end
847
- when 6 then
848
- # line 38 "ragel/i18n/zh_cn.rb.rl"
849
- begin
850
-
851
- p = store_keyword_content(:feature, data, p, eof)
852
- end
853
- when 7 then
854
- # line 42 "ragel/i18n/zh_cn.rb.rl"
855
- begin
856
-
857
- p = store_keyword_content(:background, data, p, eof)
858
- end
859
- when 8 then
860
- # line 46 "ragel/i18n/zh_cn.rb.rl"
861
- begin
862
-
863
- p = store_keyword_content(:scenario, data, p, eof)
864
- end
865
- when 9 then
866
- # line 50 "ragel/i18n/zh_cn.rb.rl"
867
- begin
868
-
869
- p = store_keyword_content(:scenario_outline, data, p, eof)
870
- end
871
- when 10 then
872
- # line 54 "ragel/i18n/zh_cn.rb.rl"
873
- begin
874
-
875
- p = store_keyword_content(:examples, data, p, eof)
876
- end
877
- when 11 then
878
- # line 58 "ragel/i18n/zh_cn.rb.rl"
879
- begin
880
-
881
- con = utf8_pack(data[@content_start...p]).strip
882
- @listener.step(@keyword, con, @current_line)
883
- end
884
- when 12 then
885
- # line 63 "ragel/i18n/zh_cn.rb.rl"
886
- begin
887
-
888
- con = utf8_pack(data[@content_start...p]).strip
889
- @listener.comment(con, @line_number)
890
- @keyword_start = nil
891
- end
892
- when 13 then
893
- # line 69 "ragel/i18n/zh_cn.rb.rl"
894
- begin
895
-
896
- con = utf8_pack(data[@content_start...p]).strip
897
- @listener.tag(con, @current_line)
898
- @keyword_start = nil
899
- end
900
- when 14 then
901
- # line 75 "ragel/i18n/zh_cn.rb.rl"
902
- begin
903
-
904
- @line_number += 1
905
- end
906
- when 15 then
907
- # line 79 "ragel/i18n/zh_cn.rb.rl"
908
- begin
909
-
910
- @last_newline = p + 1
911
- end
912
- when 16 then
913
- # line 83 "ragel/i18n/zh_cn.rb.rl"
914
- begin
915
-
916
- @keyword_start ||= p
917
- end
918
- when 17 then
919
- # line 87 "ragel/i18n/zh_cn.rb.rl"
920
- begin
921
-
922
- @keyword = utf8_pack(data[@keyword_start...p]).sub(/:$/,'')
923
- @keyword_start = nil
924
- end
925
- when 18 then
926
- # line 92 "ragel/i18n/zh_cn.rb.rl"
927
- begin
928
-
929
- @next_keyword_start = p
930
- end
931
- when 19 then
932
- # line 96 "ragel/i18n/zh_cn.rb.rl"
933
- begin
934
-
935
- p = p - 1
936
- current_row = []
937
- @current_line = @line_number
938
- end
939
- when 20 then
940
- # line 102 "ragel/i18n/zh_cn.rb.rl"
941
- begin
942
-
943
- @content_start = p
944
- end
945
- when 21 then
946
- # line 106 "ragel/i18n/zh_cn.rb.rl"
947
- begin
948
-
949
- con = utf8_pack(data[@content_start...p]).strip
950
- current_row << con.gsub(/\\\|/, "|").gsub(/\\n/, "\n").gsub(/\\\\/, "\\")
951
- end
952
- when 22 then
953
- # line 111 "ragel/i18n/zh_cn.rb.rl"
954
- begin
955
-
956
- @listener.row(current_row, @current_line)
957
- end
958
- when 23 then
959
- # line 115 "ragel/i18n/zh_cn.rb.rl"
960
- begin
961
-
962
- if cs < lexer_first_final
963
- content = current_line_content(data, p)
964
- raise Gherkin::Lexer::LexingError.new("Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information." % [@line_number, content])
965
- else
966
- @listener.eof
967
- end
968
- end
969
- # line 970 "lib/gherkin/lexer/zh_cn.rb"
970
- end # action switch
971
- end
972
- end
973
- if _trigger_goto
974
- next
975
- end
976
- end
977
- if _goto_level <= _again
978
- if cs == 0
979
- _goto_level = _out
980
- next
981
- end
982
- p += 1
983
- if p != pe
984
- _goto_level = _resume
985
- next
986
- end
987
- end
988
- if _goto_level <= _test_eof
989
- if p == eof
990
- __acts = _lexer_eof_actions[cs]
991
- __nacts = _lexer_actions[__acts]
992
- __acts += 1
993
- while __nacts > 0
994
- __nacts -= 1
995
- __acts += 1
996
- case _lexer_actions[__acts - 1]
997
- when 23 then
998
- # line 115 "ragel/i18n/zh_cn.rb.rl"
999
- begin
1000
-
1001
- if cs < lexer_first_final
1002
- content = current_line_content(data, p)
1003
- raise Gherkin::Lexer::LexingError.new("Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information." % [@line_number, content])
1004
- else
1005
- @listener.eof
1006
- end
1007
- end
1008
- # line 1009 "lib/gherkin/lexer/zh_cn.rb"
1009
- end # eof action switch
1010
- end
1011
- if _trigger_goto
1012
- next
1013
- end
1014
- end
1015
- end
1016
- if _goto_level <= _out
1017
- break
1018
- end
1019
- end
1020
- end
1021
-
1022
- # line 144 "ragel/i18n/zh_cn.rb.rl"
1023
- end
1024
-
1025
- def unindent(startcol, text)
1026
- text.gsub(/^[\t ]{0,#{startcol}}/, "")
1027
- end
1028
-
1029
- def store_keyword_content(event, data, p, eof)
1030
- end_point = (!@next_keyword_start or (p == eof)) ? p : @next_keyword_start
1031
- content = unindent(@start_col + 2, utf8_pack(data[@content_start...end_point])).rstrip
1032
- content_lines = content.split("\n")
1033
- name = content_lines.shift || ""
1034
- name.strip!
1035
- description = content_lines.join("\n")
1036
- @listener.__send__(event, @keyword, name, description, @current_line)
1037
- @next_keyword_start ? @next_keyword_start - 1 : p
1038
- ensure
1039
- @next_keyword_start = nil
1040
- end
1041
-
1042
- def current_line_content(data, p)
1043
- rest = data[@last_newline..-1]
1044
- utf8_pack(rest[0..rest.index(10)||-1]).strip # 10 is \n
1045
- end
1046
-
1047
- if (RUBY_VERSION =~ /^1\.9|2\.0/)
1048
- def utf8_pack(array)
1049
- array.pack("c*").force_encoding("UTF-8")
1050
- end
1051
- else
1052
- def utf8_pack(array)
1053
- array.pack("c*")
1054
- end
1055
- end
1056
- end
1057
- end
1058
- end