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,41 +0,0 @@
1
- module Gherkin
2
- module Lexer
3
- class Encoding
4
- native_impl('gherkin')
5
-
6
- COMMENT_OR_EMPTY_LINE_PATTERN = /^\s*#|^\s*$/
7
- ENCODING_PATTERN = /^\s*#\s*encoding\s*:\s*([0-9a-zA-Z\-]+)/i #:nodoc:
8
- DEFAULT_ENCODING = 'UTF-8'
9
-
10
- def read_file(path)
11
- source = File.new(path).read
12
- enc = encoding(source)
13
- if(enc != DEFAULT_ENCODING)
14
- # Read it again with different encoding
15
- source = File.new(path, "r:#{enc}:#{DEFAULT_ENCODING}").read
16
- if source.respond_to?(:encode)
17
- source = source.encode(DEFAULT_ENCODING)
18
- else
19
- require 'iconv'
20
- source = Iconv.new(DEFAULT_ENCODING, enc).iconv(source)
21
- end
22
- end
23
- source
24
- end
25
-
26
- private
27
-
28
- def encoding(source)
29
- encoding = DEFAULT_ENCODING
30
- source.each_line do |line|
31
- break unless COMMENT_OR_EMPTY_LINE_PATTERN =~ line
32
- if ENCODING_PATTERN =~ line
33
- encoding = $1
34
- break
35
- end
36
- end
37
- encoding.upcase
38
- end
39
- end
40
- end
41
- end
@@ -1,995 +0,0 @@
1
-
2
- # line 1 "ragel/i18n/eo.rb.rl"
3
- require 'gherkin/native'
4
-
5
- module Gherkin
6
- module Lexer
7
- class Eo #:nodoc:
8
- native_impl('gherkin')
9
-
10
-
11
- # line 125 "ragel/i18n/eo.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/eo.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, 17, 18, 19, 35, 36, 37,
54
- 39, 41, 46, 51, 56, 61, 65, 69,
55
- 71, 72, 73, 74, 75, 76, 77, 78,
56
- 79, 80, 81, 82, 83, 84, 85, 86,
57
- 87, 89, 91, 96, 103, 108, 109, 111,
58
- 112, 113, 114, 115, 116, 117, 118, 119,
59
- 120, 121, 122, 123, 124, 125, 126, 127,
60
- 128, 135, 137, 139, 141, 143, 145, 147,
61
- 163, 164, 165, 166, 167, 168, 169, 181,
62
- 183, 185, 187, 189, 191, 193, 195, 197,
63
- 199, 201, 203, 205, 207, 209, 211, 213,
64
- 216, 218, 220, 222, 224, 226, 228, 231,
65
- 233, 235, 237, 239, 241, 243, 245, 247,
66
- 249, 251, 253, 255, 257, 259, 261, 263,
67
- 265, 267, 269, 271, 273, 276, 279, 281,
68
- 283, 285, 287, 289, 290, 291, 292, 293,
69
- 294, 295, 296, 297, 298, 299, 300, 301,
70
- 302, 303, 304, 305, 306, 307, 308, 309,
71
- 310, 311, 312, 324, 326, 328, 330, 332,
72
- 334, 336, 338, 340, 342, 344, 346, 348,
73
- 350, 352, 354, 356, 359, 361, 363, 365,
74
- 367, 369, 371, 373, 375, 378, 380, 382,
75
- 384, 386, 388, 390, 393, 395, 397, 399,
76
- 401, 403, 404, 405, 406, 407, 408, 409,
77
- 410, 411, 424, 426, 428, 430, 432, 434,
78
- 436, 438, 440, 442, 444, 446, 448, 450,
79
- 452, 454, 456, 459, 461, 463, 465, 467,
80
- 469, 471, 473, 475, 477, 479, 482, 484,
81
- 486, 488, 490, 492, 494, 496, 498, 500,
82
- 502, 504, 506, 508, 510, 512, 514, 516,
83
- 518, 520, 523, 526, 528, 530, 532, 534,
84
- 536, 537, 538, 539, 540, 541, 542, 543,
85
- 544, 556, 558, 560, 562, 564, 566, 568,
86
- 570, 572, 574, 576, 578, 580, 582, 584,
87
- 586, 588, 590, 592, 594, 596, 598, 600,
88
- 602, 604, 606, 608, 610, 612, 614, 616,
89
- 618, 620, 622, 624, 626, 628, 630, 632,
90
- 634, 636, 638, 640, 642, 644, 646, 648,
91
- 650, 652, 654, 658, 664, 667, 669, 675,
92
- 691
93
- ]
94
-
95
- class << self
96
- attr_accessor :_lexer_trans_keys
97
- private :_lexer_trans_keys, :_lexer_trans_keys=
98
- end
99
- self._lexer_trans_keys = [
100
- -17, 10, 32, 34, 35, 37, 42, 64,
101
- 68, 69, 70, 75, 83, 84, 124, 9,
102
- 13, -69, -65, 10, 32, 34, 35, 37,
103
- 42, 64, 68, 69, 70, 75, 83, 84,
104
- 124, 9, 13, 34, 34, 10, 13, 10,
105
- 13, 10, 32, 34, 9, 13, 10, 32,
106
- 34, 9, 13, 10, 32, 34, 9, 13,
107
- 10, 32, 34, 9, 13, 10, 32, 9,
108
- 13, 10, 32, 9, 13, 10, 13, 10,
109
- 95, 70, 69, 65, 84, 85, 82, 69,
110
- 95, 69, 78, 68, 95, 37, 32, 10,
111
- 13, 10, 13, 13, 32, 64, 9, 10,
112
- 9, 10, 13, 32, 64, 11, 12, 10,
113
- 32, 64, 9, 13, 111, 32, 110, 105,
114
- 116, 97, -60, -75, 111, 107, 122, 101,
115
- 109, 112, 108, 111, 106, 58, 10, 10,
116
- 10, 32, 35, 84, 124, 9, 13, 10,
117
- 114, 10, 97, 10, 106, 10, 116, 10,
118
- 111, 10, 58, 10, 32, 34, 35, 37,
119
- 42, 64, 68, 69, 70, 75, 83, 84,
120
- 124, 9, 13, 111, 110, 111, 58, 10,
121
- 10, 10, 32, 35, 37, 42, 64, 68,
122
- 75, 83, 84, 9, 13, 10, 95, 10,
123
- 70, 10, 69, 10, 65, 10, 84, 10,
124
- 85, 10, 82, 10, 69, 10, 95, 10,
125
- 69, 10, 78, 10, 68, 10, 95, 10,
126
- 37, 10, 32, 10, 111, 10, 32, 110,
127
- 10, 105, 10, 116, 10, 97, -60, 10,
128
- -75, 10, 10, 111, 10, 97, 111, 10,
129
- 106, 10, 110, 10, 116, 10, 117, 10,
130
- 114, 10, 111, 10, 32, 10, 100, 10,
131
- 101, 10, 32, 10, 108, 10, 97, 10,
132
- 32, 10, 115, 10, 99, 10, 101, 10,
133
- 110, 10, 97, 10, 114, 10, 111, 10,
134
- 58, 10, 99, 101, 10, 32, 100, 10,
135
- 114, 10, 97, 10, 106, 10, 116, 97,
136
- 111, 106, 110, 116, 117, 114, 111, 32,
137
- 100, 101, 32, 108, 97, 32, 115, 99,
138
- 101, 110, 97, 114, 111, 58, 10, 10,
139
- 10, 32, 35, 37, 42, 64, 68, 75,
140
- 83, 84, 9, 13, 10, 95, 10, 70,
141
- 10, 69, 10, 65, 10, 84, 10, 85,
142
- 10, 82, 10, 69, 10, 95, 10, 69,
143
- 10, 78, 10, 68, 10, 95, 10, 37,
144
- 10, 32, 10, 111, 10, 32, 110, 10,
145
- 105, 10, 116, 10, 97, -60, 10, -75,
146
- 10, 10, 111, 10, 97, 10, 106, 10,
147
- 99, 101, 10, 101, 10, 110, 10, 97,
148
- 10, 114, 10, 111, 10, 58, 10, 32,
149
- 100, 10, 114, 10, 97, 10, 106, 10,
150
- 116, 99, 101, 101, 110, 97, 114, 111,
151
- 58, 10, 10, 10, 32, 35, 37, 42,
152
- 64, 68, 70, 75, 83, 84, 9, 13,
153
- 10, 95, 10, 70, 10, 69, 10, 65,
154
- 10, 84, 10, 85, 10, 82, 10, 69,
155
- 10, 95, 10, 69, 10, 78, 10, 68,
156
- 10, 95, 10, 37, 10, 32, 10, 111,
157
- 10, 32, 110, 10, 105, 10, 116, 10,
158
- 97, -60, 10, -75, 10, 10, 111, 10,
159
- 111, 10, 110, 10, 111, 10, 58, 10,
160
- 97, 111, 10, 106, 10, 110, 10, 116,
161
- 10, 117, 10, 114, 10, 111, 10, 32,
162
- 10, 100, 10, 101, 10, 32, 10, 108,
163
- 10, 97, 10, 32, 10, 115, 10, 99,
164
- 10, 101, 10, 110, 10, 97, 10, 114,
165
- 10, 99, 101, 10, 32, 100, 10, 114,
166
- 10, 97, 10, 106, 10, 116, 32, 100,
167
- 114, 97, 106, 116, 111, 58, 10, 10,
168
- 10, 32, 35, 37, 64, 69, 70, 75,
169
- 83, 84, 9, 13, 10, 95, 10, 70,
170
- 10, 69, 10, 65, 10, 84, 10, 85,
171
- 10, 82, 10, 69, 10, 95, 10, 69,
172
- 10, 78, 10, 68, 10, 95, 10, 37,
173
- 10, 107, 10, 122, 10, 101, 10, 109,
174
- 10, 112, 10, 108, 10, 111, 10, 106,
175
- 10, 58, 10, 111, 10, 110, 10, 111,
176
- 10, 111, 10, 110, 10, 116, 10, 117,
177
- 10, 114, 10, 111, 10, 32, 10, 100,
178
- 10, 101, 10, 32, 10, 108, 10, 97,
179
- 10, 32, 10, 115, 10, 99, 10, 101,
180
- 10, 110, 10, 97, 10, 114, 10, 114,
181
- 10, 97, 10, 106, 10, 116, 32, 124,
182
- 9, 13, 10, 32, 92, 124, 9, 13,
183
- 10, 92, 124, 10, 92, 10, 32, 92,
184
- 124, 9, 13, 10, 32, 34, 35, 37,
185
- 42, 64, 68, 69, 70, 75, 83, 84,
186
- 124, 9, 13, 0
187
- ]
188
-
189
- class << self
190
- attr_accessor :_lexer_single_lengths
191
- private :_lexer_single_lengths, :_lexer_single_lengths=
192
- end
193
- self._lexer_single_lengths = [
194
- 0, 15, 1, 1, 14, 1, 1, 2,
195
- 2, 3, 3, 3, 3, 2, 2, 2,
196
- 1, 1, 1, 1, 1, 1, 1, 1,
197
- 1, 1, 1, 1, 1, 1, 1, 1,
198
- 2, 2, 3, 5, 3, 1, 2, 1,
199
- 1, 1, 1, 1, 1, 1, 1, 1,
200
- 1, 1, 1, 1, 1, 1, 1, 1,
201
- 5, 2, 2, 2, 2, 2, 2, 14,
202
- 1, 1, 1, 1, 1, 1, 10, 2,
203
- 2, 2, 2, 2, 2, 2, 2, 2,
204
- 2, 2, 2, 2, 2, 2, 2, 3,
205
- 2, 2, 2, 2, 2, 2, 3, 2,
206
- 2, 2, 2, 2, 2, 2, 2, 2,
207
- 2, 2, 2, 2, 2, 2, 2, 2,
208
- 2, 2, 2, 2, 3, 3, 2, 2,
209
- 2, 2, 2, 1, 1, 1, 1, 1,
210
- 1, 1, 1, 1, 1, 1, 1, 1,
211
- 1, 1, 1, 1, 1, 1, 1, 1,
212
- 1, 1, 10, 2, 2, 2, 2, 2,
213
- 2, 2, 2, 2, 2, 2, 2, 2,
214
- 2, 2, 2, 3, 2, 2, 2, 2,
215
- 2, 2, 2, 2, 3, 2, 2, 2,
216
- 2, 2, 2, 3, 2, 2, 2, 2,
217
- 2, 1, 1, 1, 1, 1, 1, 1,
218
- 1, 11, 2, 2, 2, 2, 2, 2,
219
- 2, 2, 2, 2, 2, 2, 2, 2,
220
- 2, 2, 3, 2, 2, 2, 2, 2,
221
- 2, 2, 2, 2, 2, 3, 2, 2,
222
- 2, 2, 2, 2, 2, 2, 2, 2,
223
- 2, 2, 2, 2, 2, 2, 2, 2,
224
- 2, 3, 3, 2, 2, 2, 2, 2,
225
- 1, 1, 1, 1, 1, 1, 1, 1,
226
- 10, 2, 2, 2, 2, 2, 2, 2,
227
- 2, 2, 2, 2, 2, 2, 2, 2,
228
- 2, 2, 2, 2, 2, 2, 2, 2,
229
- 2, 2, 2, 2, 2, 2, 2, 2,
230
- 2, 2, 2, 2, 2, 2, 2, 2,
231
- 2, 2, 2, 2, 2, 2, 2, 2,
232
- 2, 2, 2, 4, 3, 2, 4, 14,
233
- 0
234
- ]
235
-
236
- class << self
237
- attr_accessor :_lexer_range_lengths
238
- private :_lexer_range_lengths, :_lexer_range_lengths=
239
- end
240
- self._lexer_range_lengths = [
241
- 0, 1, 0, 0, 1, 0, 0, 0,
242
- 0, 1, 1, 1, 1, 1, 1, 0,
243
- 0, 0, 0, 0, 0, 0, 0, 0,
244
- 0, 0, 0, 0, 0, 0, 0, 0,
245
- 0, 0, 1, 1, 1, 0, 0, 0,
246
- 0, 0, 0, 0, 0, 0, 0, 0,
247
- 0, 0, 0, 0, 0, 0, 0, 0,
248
- 1, 0, 0, 0, 0, 0, 0, 1,
249
- 0, 0, 0, 0, 0, 0, 1, 0,
250
- 0, 0, 0, 0, 0, 0, 0, 0,
251
- 0, 0, 0, 0, 0, 0, 0, 0,
252
- 0, 0, 0, 0, 0, 0, 0, 0,
253
- 0, 0, 0, 0, 0, 0, 0, 0,
254
- 0, 0, 0, 0, 0, 0, 0, 0,
255
- 0, 0, 0, 0, 0, 0, 0, 0,
256
- 0, 0, 0, 0, 0, 0, 0, 0,
257
- 0, 0, 0, 0, 0, 0, 0, 0,
258
- 0, 0, 0, 0, 0, 0, 0, 0,
259
- 0, 0, 1, 0, 0, 0, 0, 0,
260
- 0, 0, 0, 0, 0, 0, 0, 0,
261
- 0, 0, 0, 0, 0, 0, 0, 0,
262
- 0, 0, 0, 0, 0, 0, 0, 0,
263
- 0, 0, 0, 0, 0, 0, 0, 0,
264
- 0, 0, 0, 0, 0, 0, 0, 0,
265
- 0, 1, 0, 0, 0, 0, 0, 0,
266
- 0, 0, 0, 0, 0, 0, 0, 0,
267
- 0, 0, 0, 0, 0, 0, 0, 0,
268
- 0, 0, 0, 0, 0, 0, 0, 0,
269
- 0, 0, 0, 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
- 1, 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, 0, 0, 0, 0, 0,
279
- 0, 0, 1, 1, 0, 0, 1, 1,
280
- 0
281
- ]
282
-
283
- class << self
284
- attr_accessor :_lexer_index_offsets
285
- private :_lexer_index_offsets, :_lexer_index_offsets=
286
- end
287
- self._lexer_index_offsets = [
288
- 0, 0, 17, 19, 21, 37, 39, 41,
289
- 44, 47, 52, 57, 62, 67, 71, 75,
290
- 78, 80, 82, 84, 86, 88, 90, 92,
291
- 94, 96, 98, 100, 102, 104, 106, 108,
292
- 110, 113, 116, 121, 128, 133, 135, 138,
293
- 140, 142, 144, 146, 148, 150, 152, 154,
294
- 156, 158, 160, 162, 164, 166, 168, 170,
295
- 172, 179, 182, 185, 188, 191, 194, 197,
296
- 213, 215, 217, 219, 221, 223, 225, 237,
297
- 240, 243, 246, 249, 252, 255, 258, 261,
298
- 264, 267, 270, 273, 276, 279, 282, 285,
299
- 289, 292, 295, 298, 301, 304, 307, 311,
300
- 314, 317, 320, 323, 326, 329, 332, 335,
301
- 338, 341, 344, 347, 350, 353, 356, 359,
302
- 362, 365, 368, 371, 374, 378, 382, 385,
303
- 388, 391, 394, 397, 399, 401, 403, 405,
304
- 407, 409, 411, 413, 415, 417, 419, 421,
305
- 423, 425, 427, 429, 431, 433, 435, 437,
306
- 439, 441, 443, 455, 458, 461, 464, 467,
307
- 470, 473, 476, 479, 482, 485, 488, 491,
308
- 494, 497, 500, 503, 507, 510, 513, 516,
309
- 519, 522, 525, 528, 531, 535, 538, 541,
310
- 544, 547, 550, 553, 557, 560, 563, 566,
311
- 569, 572, 574, 576, 578, 580, 582, 584,
312
- 586, 588, 601, 604, 607, 610, 613, 616,
313
- 619, 622, 625, 628, 631, 634, 637, 640,
314
- 643, 646, 649, 653, 656, 659, 662, 665,
315
- 668, 671, 674, 677, 680, 683, 687, 690,
316
- 693, 696, 699, 702, 705, 708, 711, 714,
317
- 717, 720, 723, 726, 729, 732, 735, 738,
318
- 741, 744, 748, 752, 755, 758, 761, 764,
319
- 767, 769, 771, 773, 775, 777, 779, 781,
320
- 783, 795, 798, 801, 804, 807, 810, 813,
321
- 816, 819, 822, 825, 828, 831, 834, 837,
322
- 840, 843, 846, 849, 852, 855, 858, 861,
323
- 864, 867, 870, 873, 876, 879, 882, 885,
324
- 888, 891, 894, 897, 900, 903, 906, 909,
325
- 912, 915, 918, 921, 924, 927, 930, 933,
326
- 936, 939, 942, 946, 952, 956, 959, 965,
327
- 981
328
- ]
329
-
330
- class << self
331
- attr_accessor :_lexer_indicies
332
- private :_lexer_indicies, :_lexer_indicies=
333
- end
334
- self._lexer_indicies = [
335
- 1, 3, 2, 4, 5, 6, 7, 8,
336
- 9, 10, 11, 12, 13, 14, 15, 2,
337
- 0, 16, 0, 2, 0, 3, 2, 4,
338
- 5, 6, 7, 8, 9, 10, 11, 12,
339
- 13, 14, 15, 2, 0, 17, 0, 18,
340
- 0, 20, 21, 19, 23, 24, 22, 27,
341
- 26, 28, 26, 25, 31, 30, 32, 30,
342
- 29, 31, 30, 33, 30, 29, 31, 30,
343
- 34, 30, 29, 36, 35, 35, 0, 3,
344
- 37, 37, 0, 39, 40, 38, 3, 0,
345
- 41, 0, 42, 0, 43, 0, 44, 0,
346
- 45, 0, 46, 0, 47, 0, 48, 0,
347
- 49, 0, 50, 0, 51, 0, 52, 0,
348
- 53, 0, 54, 0, 55, 0, 57, 58,
349
- 56, 60, 61, 59, 0, 0, 0, 0,
350
- 62, 63, 64, 63, 63, 66, 65, 62,
351
- 3, 67, 8, 67, 0, 68, 0, 55,
352
- 69, 0, 70, 0, 71, 0, 72, 0,
353
- 73, 0, 74, 0, 75, 0, 76, 0,
354
- 77, 0, 78, 0, 79, 0, 80, 0,
355
- 81, 0, 82, 0, 83, 0, 84, 0,
356
- 86, 85, 88, 87, 88, 89, 90, 91,
357
- 90, 89, 87, 88, 92, 87, 88, 93,
358
- 87, 88, 94, 87, 88, 95, 87, 88,
359
- 96, 87, 88, 97, 87, 99, 98, 100,
360
- 101, 102, 103, 104, 105, 106, 107, 108,
361
- 109, 110, 111, 98, 0, 112, 0, 113,
362
- 0, 114, 0, 115, 0, 117, 116, 119,
363
- 118, 119, 120, 121, 122, 123, 121, 124,
364
- 125, 126, 127, 120, 118, 119, 128, 118,
365
- 119, 129, 118, 119, 130, 118, 119, 131,
366
- 118, 119, 132, 118, 119, 133, 118, 119,
367
- 134, 118, 119, 135, 118, 119, 136, 118,
368
- 119, 137, 118, 119, 138, 118, 119, 139,
369
- 118, 119, 140, 118, 119, 141, 118, 119,
370
- 142, 118, 119, 143, 118, 119, 142, 144,
371
- 118, 119, 145, 118, 119, 146, 118, 119,
372
- 147, 118, 148, 119, 118, 149, 119, 118,
373
- 119, 150, 118, 119, 151, 152, 118, 119,
374
- 150, 118, 119, 153, 118, 119, 154, 118,
375
- 119, 155, 118, 119, 156, 118, 119, 157,
376
- 118, 119, 158, 118, 119, 159, 118, 119,
377
- 160, 118, 119, 161, 118, 119, 162, 118,
378
- 119, 163, 118, 119, 164, 118, 119, 165,
379
- 118, 119, 166, 118, 119, 167, 118, 119,
380
- 168, 118, 119, 169, 118, 119, 170, 118,
381
- 119, 171, 118, 119, 142, 118, 119, 166,
382
- 172, 118, 119, 142, 150, 118, 119, 173,
383
- 118, 119, 174, 118, 119, 175, 118, 119,
384
- 170, 118, 176, 177, 0, 75, 0, 178,
385
- 0, 179, 0, 180, 0, 181, 0, 182,
386
- 0, 183, 0, 184, 0, 185, 0, 186,
387
- 0, 187, 0, 188, 0, 189, 0, 190,
388
- 0, 191, 0, 192, 0, 193, 0, 194,
389
- 0, 195, 0, 196, 0, 197, 0, 199,
390
- 198, 201, 200, 201, 202, 203, 204, 205,
391
- 203, 206, 207, 208, 209, 202, 200, 201,
392
- 210, 200, 201, 211, 200, 201, 212, 200,
393
- 201, 213, 200, 201, 214, 200, 201, 215,
394
- 200, 201, 216, 200, 201, 217, 200, 201,
395
- 218, 200, 201, 219, 200, 201, 220, 200,
396
- 201, 221, 200, 201, 222, 200, 201, 223,
397
- 200, 201, 224, 200, 201, 225, 200, 201,
398
- 224, 226, 200, 201, 227, 200, 201, 228,
399
- 200, 201, 229, 200, 230, 201, 200, 231,
400
- 201, 200, 201, 232, 200, 201, 233, 200,
401
- 201, 232, 200, 201, 234, 235, 200, 201,
402
- 236, 200, 201, 237, 200, 201, 238, 200,
403
- 201, 239, 200, 201, 240, 200, 201, 224,
404
- 200, 201, 224, 232, 200, 201, 241, 200,
405
- 201, 242, 200, 201, 243, 200, 201, 239,
406
- 200, 244, 245, 0, 246, 0, 247, 0,
407
- 248, 0, 249, 0, 250, 0, 251, 0,
408
- 253, 252, 255, 254, 255, 256, 257, 258,
409
- 259, 257, 260, 261, 262, 263, 264, 256,
410
- 254, 255, 265, 254, 255, 266, 254, 255,
411
- 267, 254, 255, 268, 254, 255, 269, 254,
412
- 255, 270, 254, 255, 271, 254, 255, 272,
413
- 254, 255, 273, 254, 255, 274, 254, 255,
414
- 275, 254, 255, 276, 254, 255, 277, 254,
415
- 255, 278, 254, 255, 279, 254, 255, 280,
416
- 254, 255, 279, 281, 254, 255, 282, 254,
417
- 255, 283, 254, 255, 284, 254, 285, 255,
418
- 254, 286, 255, 254, 255, 287, 254, 255,
419
- 288, 254, 255, 289, 254, 255, 290, 254,
420
- 255, 279, 254, 255, 291, 292, 254, 255,
421
- 287, 254, 255, 293, 254, 255, 294, 254,
422
- 255, 295, 254, 255, 296, 254, 255, 297,
423
- 254, 255, 298, 254, 255, 299, 254, 255,
424
- 300, 254, 255, 301, 254, 255, 302, 254,
425
- 255, 303, 254, 255, 304, 254, 255, 305,
426
- 254, 255, 306, 254, 255, 307, 254, 255,
427
- 308, 254, 255, 309, 254, 255, 289, 254,
428
- 255, 306, 310, 254, 255, 279, 287, 254,
429
- 255, 311, 254, 255, 312, 254, 255, 313,
430
- 254, 255, 289, 254, 55, 75, 0, 314,
431
- 0, 315, 0, 316, 0, 317, 0, 318,
432
- 0, 319, 0, 321, 320, 323, 322, 323,
433
- 324, 325, 326, 325, 327, 328, 329, 330,
434
- 331, 324, 322, 323, 332, 322, 323, 333,
435
- 322, 323, 334, 322, 323, 335, 322, 323,
436
- 336, 322, 323, 337, 322, 323, 338, 322,
437
- 323, 339, 322, 323, 340, 322, 323, 341,
438
- 322, 323, 342, 322, 323, 343, 322, 323,
439
- 344, 322, 323, 345, 322, 323, 346, 322,
440
- 323, 347, 322, 323, 348, 322, 323, 349,
441
- 322, 323, 350, 322, 323, 351, 322, 323,
442
- 352, 322, 323, 353, 322, 323, 354, 322,
443
- 323, 355, 322, 323, 356, 322, 323, 353,
444
- 322, 323, 357, 322, 323, 358, 322, 323,
445
- 359, 322, 323, 360, 322, 323, 361, 322,
446
- 323, 362, 322, 323, 363, 322, 323, 364,
447
- 322, 323, 365, 322, 323, 366, 322, 323,
448
- 367, 322, 323, 368, 322, 323, 369, 322,
449
- 323, 370, 322, 323, 371, 322, 323, 372,
450
- 322, 323, 373, 322, 323, 374, 322, 323,
451
- 356, 322, 323, 375, 322, 323, 376, 322,
452
- 323, 377, 322, 323, 356, 322, 378, 379,
453
- 378, 0, 382, 381, 383, 384, 381, 380,
454
- 0, 386, 387, 385, 0, 386, 385, 382,
455
- 388, 386, 387, 388, 385, 382, 389, 390,
456
- 391, 392, 393, 394, 395, 396, 397, 398,
457
- 399, 400, 401, 389, 0, 402, 0
458
- ]
459
-
460
- class << self
461
- attr_accessor :_lexer_trans_targs
462
- private :_lexer_trans_targs, :_lexer_trans_targs=
463
- end
464
- self._lexer_trans_targs = [
465
- 0, 2, 4, 4, 5, 15, 17, 31,
466
- 34, 37, 45, 64, 122, 184, 248, 306,
467
- 3, 6, 7, 8, 9, 8, 8, 9,
468
- 8, 10, 10, 10, 11, 10, 10, 10,
469
- 11, 12, 13, 14, 4, 14, 15, 4,
470
- 16, 18, 19, 20, 21, 22, 23, 24,
471
- 25, 26, 27, 28, 29, 30, 312, 32,
472
- 33, 4, 16, 33, 4, 16, 35, 36,
473
- 4, 35, 34, 36, 38, 39, 40, 41,
474
- 42, 43, 44, 31, 46, 47, 48, 49,
475
- 50, 51, 52, 53, 54, 55, 56, 55,
476
- 56, 56, 4, 57, 58, 59, 60, 61,
477
- 62, 63, 4, 4, 5, 15, 17, 31,
478
- 34, 37, 45, 64, 122, 184, 248, 306,
479
- 65, 66, 67, 68, 69, 70, 69, 70,
480
- 70, 4, 71, 85, 86, 94, 116, 118,
481
- 72, 73, 74, 75, 76, 77, 78, 79,
482
- 80, 81, 82, 83, 84, 4, 63, 87,
483
- 88, 89, 90, 91, 92, 93, 85, 95,
484
- 96, 97, 98, 99, 100, 101, 102, 103,
485
- 104, 105, 106, 107, 108, 109, 110, 111,
486
- 112, 113, 114, 115, 117, 119, 120, 121,
487
- 123, 124, 125, 126, 127, 128, 129, 130,
488
- 131, 132, 133, 134, 135, 136, 137, 138,
489
- 139, 140, 141, 142, 143, 144, 145, 146,
490
- 145, 146, 146, 4, 147, 161, 162, 170,
491
- 172, 180, 148, 149, 150, 151, 152, 153,
492
- 154, 155, 156, 157, 158, 159, 160, 4,
493
- 63, 163, 164, 165, 166, 167, 168, 169,
494
- 161, 171, 173, 179, 174, 175, 176, 177,
495
- 178, 181, 182, 183, 185, 247, 186, 187,
496
- 188, 189, 190, 191, 192, 193, 192, 193,
497
- 193, 4, 194, 208, 209, 217, 221, 241,
498
- 243, 195, 196, 197, 198, 199, 200, 201,
499
- 202, 203, 204, 205, 206, 207, 4, 63,
500
- 210, 211, 212, 213, 214, 215, 216, 208,
501
- 218, 219, 220, 222, 223, 224, 225, 226,
502
- 227, 228, 229, 230, 231, 232, 233, 234,
503
- 235, 236, 237, 238, 239, 240, 242, 244,
504
- 245, 246, 249, 250, 251, 252, 253, 254,
505
- 255, 256, 255, 256, 256, 4, 257, 271,
506
- 280, 283, 297, 302, 258, 259, 260, 261,
507
- 262, 263, 264, 265, 266, 267, 268, 269,
508
- 270, 4, 272, 273, 274, 275, 276, 277,
509
- 278, 279, 63, 281, 282, 284, 285, 286,
510
- 287, 288, 289, 290, 291, 292, 293, 294,
511
- 295, 296, 297, 298, 299, 300, 301, 303,
512
- 304, 305, 306, 307, 308, 310, 311, 309,
513
- 307, 308, 309, 307, 310, 311, 5, 15,
514
- 17, 31, 34, 37, 45, 64, 122, 184,
515
- 248, 306, 0
516
- ]
517
-
518
- class << self
519
- attr_accessor :_lexer_trans_actions
520
- private :_lexer_trans_actions, :_lexer_trans_actions=
521
- end
522
- self._lexer_trans_actions = [
523
- 43, 0, 0, 54, 3, 1, 0, 29,
524
- 1, 29, 29, 29, 29, 29, 29, 35,
525
- 0, 0, 0, 7, 139, 48, 0, 102,
526
- 9, 5, 45, 134, 45, 0, 33, 122,
527
- 33, 33, 0, 11, 106, 0, 0, 114,
528
- 25, 0, 0, 0, 0, 0, 0, 0,
529
- 0, 0, 0, 0, 0, 0, 0, 0,
530
- 57, 149, 126, 0, 110, 23, 0, 27,
531
- 118, 27, 51, 0, 0, 0, 0, 0,
532
- 0, 0, 0, 0, 0, 0, 0, 0,
533
- 0, 0, 0, 0, 0, 57, 144, 0,
534
- 54, 0, 81, 84, 0, 0, 0, 0,
535
- 0, 21, 31, 130, 60, 57, 31, 63,
536
- 57, 63, 63, 63, 63, 63, 63, 66,
537
- 0, 0, 0, 0, 57, 144, 0, 54,
538
- 0, 72, 33, 84, 84, 84, 84, 84,
539
- 0, 0, 0, 0, 0, 0, 0, 0,
540
- 0, 0, 0, 0, 0, 15, 15, 0,
541
- 0, 0, 0, 0, 0, 0, 0, 0,
542
- 0, 0, 0, 0, 0, 0, 0, 0,
543
- 0, 0, 0, 0, 0, 0, 0, 0,
544
- 0, 0, 0, 0, 0, 0, 0, 0,
545
- 0, 0, 0, 0, 0, 0, 0, 0,
546
- 0, 0, 0, 0, 0, 0, 0, 0,
547
- 0, 0, 0, 0, 0, 0, 57, 144,
548
- 0, 54, 0, 78, 33, 84, 84, 84,
549
- 84, 84, 0, 0, 0, 0, 0, 0,
550
- 0, 0, 0, 0, 0, 0, 0, 19,
551
- 19, 0, 0, 0, 0, 0, 0, 0,
552
- 0, 0, 0, 0, 0, 0, 0, 0,
553
- 0, 0, 0, 0, 0, 0, 0, 0,
554
- 0, 0, 0, 0, 57, 144, 0, 54,
555
- 0, 75, 33, 84, 84, 84, 84, 84,
556
- 84, 0, 0, 0, 0, 0, 0, 0,
557
- 0, 0, 0, 0, 0, 0, 17, 17,
558
- 0, 0, 0, 0, 0, 0, 0, 0,
559
- 0, 0, 0, 0, 0, 0, 0, 0,
560
- 0, 0, 0, 0, 0, 0, 0, 0,
561
- 0, 0, 0, 0, 0, 0, 0, 0,
562
- 0, 0, 0, 0, 0, 0, 0, 0,
563
- 57, 144, 0, 54, 0, 69, 33, 84,
564
- 84, 84, 84, 84, 0, 0, 0, 0,
565
- 0, 0, 0, 0, 0, 0, 0, 0,
566
- 0, 13, 0, 0, 0, 0, 0, 0,
567
- 0, 0, 13, 0, 0, 0, 0, 0,
568
- 0, 0, 0, 0, 0, 0, 0, 0,
569
- 0, 0, 0, 0, 0, 0, 0, 0,
570
- 0, 0, 0, 0, 37, 37, 54, 37,
571
- 87, 0, 0, 39, 0, 0, 93, 90,
572
- 41, 96, 90, 96, 96, 96, 96, 96,
573
- 96, 99, 0
574
- ]
575
-
576
- class << self
577
- attr_accessor :_lexer_eof_actions
578
- private :_lexer_eof_actions, :_lexer_eof_actions=
579
- end
580
- self._lexer_eof_actions = [
581
- 0, 43, 43, 43, 43, 43, 43, 43,
582
- 43, 43, 43, 43, 43, 43, 43, 43,
583
- 43, 43, 43, 43, 43, 43, 43, 43,
584
- 43, 43, 43, 43, 43, 43, 43, 43,
585
- 43, 43, 43, 43, 43, 43, 43, 43,
586
- 43, 43, 43, 43, 43, 43, 43, 43,
587
- 43, 43, 43, 43, 43, 43, 43, 43,
588
- 43, 43, 43, 43, 43, 43, 43, 43,
589
- 43, 43, 43, 43, 43, 43, 43, 43,
590
- 43, 43, 43, 43, 43, 43, 43, 43,
591
- 43, 43, 43, 43, 43, 43, 43, 43,
592
- 43, 43, 43, 43, 43, 43, 43, 43,
593
- 43, 43, 43, 43, 43, 43, 43, 43,
594
- 43, 43, 43, 43, 43, 43, 43, 43,
595
- 43, 43, 43, 43, 43, 43, 43, 43,
596
- 43, 43, 43, 43, 43, 43, 43, 43,
597
- 43, 43, 43, 43, 43, 43, 43, 43,
598
- 43, 43, 43, 43, 43, 43, 43, 43,
599
- 43, 43, 43, 43, 43, 43, 43, 43,
600
- 43, 43, 43, 43, 43, 43, 43, 43,
601
- 43, 43, 43, 43, 43, 43, 43, 43,
602
- 43, 43, 43, 43, 43, 43, 43, 43,
603
- 43, 43, 43, 43, 43, 43, 43, 43,
604
- 43, 43, 43, 43, 43, 43, 43, 43,
605
- 43, 43, 43, 43, 43, 43, 43, 43,
606
- 43, 43, 43, 43, 43, 43, 43, 43,
607
- 43, 43, 43, 43, 43, 43, 43, 43,
608
- 43, 43, 43, 43, 43, 43, 43, 43,
609
- 43, 43, 43, 43, 43, 43, 43, 43,
610
- 43, 43, 43, 43, 43, 43, 43, 43,
611
- 43, 43, 43, 43, 43, 43, 43, 43,
612
- 43, 43, 43, 43, 43, 43, 43, 43,
613
- 43, 43, 43, 43, 43, 43, 43, 43,
614
- 43, 43, 43, 43, 43, 43, 43, 43,
615
- 43, 43, 43, 43, 43, 43, 43, 43,
616
- 43, 43, 43, 43, 43, 43, 43, 43,
617
- 43, 43, 43, 43, 43, 43, 43, 43,
618
- 43, 43, 43, 43, 43, 43, 43, 43,
619
- 43, 43, 43, 43, 43, 43, 43, 43,
620
- 43
621
- ]
622
-
623
- class << self
624
- attr_accessor :lexer_start
625
- end
626
- self.lexer_start = 1;
627
- class << self
628
- attr_accessor :lexer_first_final
629
- end
630
- self.lexer_first_final = 312;
631
- class << self
632
- attr_accessor :lexer_error
633
- end
634
- self.lexer_error = 0;
635
-
636
- class << self
637
- attr_accessor :lexer_en_main
638
- end
639
- self.lexer_en_main = 1;
640
-
641
-
642
- # line 133 "ragel/i18n/eo.rb.rl"
643
- end
644
-
645
- def scan(data)
646
- data = (data + "\n%_FEATURE_END_%").unpack("c*") # Explicit EOF simplifies things considerably
647
- eof = pe = data.length
648
-
649
- @line_number = 1
650
- @last_newline = 0
651
-
652
-
653
- # line 654 "lib/gherkin/lexer/eo.rb"
654
- begin
655
- p ||= 0
656
- pe ||= data.length
657
- cs = lexer_start
658
- end
659
-
660
- # line 143 "ragel/i18n/eo.rb.rl"
661
-
662
- # line 663 "lib/gherkin/lexer/eo.rb"
663
- begin
664
- _klen, _trans, _keys, _acts, _nacts = nil
665
- _goto_level = 0
666
- _resume = 10
667
- _eof_trans = 15
668
- _again = 20
669
- _test_eof = 30
670
- _out = 40
671
- while true
672
- _trigger_goto = false
673
- if _goto_level <= 0
674
- if p == pe
675
- _goto_level = _test_eof
676
- next
677
- end
678
- if cs == 0
679
- _goto_level = _out
680
- next
681
- end
682
- end
683
- if _goto_level <= _resume
684
- _keys = _lexer_key_offsets[cs]
685
- _trans = _lexer_index_offsets[cs]
686
- _klen = _lexer_single_lengths[cs]
687
- _break_match = false
688
-
689
- begin
690
- if _klen > 0
691
- _lower = _keys
692
- _upper = _keys + _klen - 1
693
-
694
- loop do
695
- break if _upper < _lower
696
- _mid = _lower + ( (_upper - _lower) >> 1 )
697
-
698
- if data[p].ord < _lexer_trans_keys[_mid]
699
- _upper = _mid - 1
700
- elsif data[p].ord > _lexer_trans_keys[_mid]
701
- _lower = _mid + 1
702
- else
703
- _trans += (_mid - _keys)
704
- _break_match = true
705
- break
706
- end
707
- end # loop
708
- break if _break_match
709
- _keys += _klen
710
- _trans += _klen
711
- end
712
- _klen = _lexer_range_lengths[cs]
713
- if _klen > 0
714
- _lower = _keys
715
- _upper = _keys + (_klen << 1) - 2
716
- loop do
717
- break if _upper < _lower
718
- _mid = _lower + (((_upper-_lower) >> 1) & ~1)
719
- if data[p].ord < _lexer_trans_keys[_mid]
720
- _upper = _mid - 2
721
- elsif data[p].ord > _lexer_trans_keys[_mid+1]
722
- _lower = _mid + 2
723
- else
724
- _trans += ((_mid - _keys) >> 1)
725
- _break_match = true
726
- break
727
- end
728
- end # loop
729
- break if _break_match
730
- _trans += _klen
731
- end
732
- end while false
733
- _trans = _lexer_indicies[_trans]
734
- cs = _lexer_trans_targs[_trans]
735
- if _lexer_trans_actions[_trans] != 0
736
- _acts = _lexer_trans_actions[_trans]
737
- _nacts = _lexer_actions[_acts]
738
- _acts += 1
739
- while _nacts > 0
740
- _nacts -= 1
741
- _acts += 1
742
- case _lexer_actions[_acts - 1]
743
- when 0 then
744
- # line 11 "ragel/i18n/eo.rb.rl"
745
- begin
746
-
747
- @content_start = p
748
- @current_line = @line_number
749
- @start_col = p - @last_newline - "#{@keyword}:".length
750
- end
751
- when 1 then
752
- # line 17 "ragel/i18n/eo.rb.rl"
753
- begin
754
-
755
- @current_line = @line_number
756
- @start_col = p - @last_newline
757
- end
758
- when 2 then
759
- # line 22 "ragel/i18n/eo.rb.rl"
760
- begin
761
-
762
- @content_start = p
763
- end
764
- when 3 then
765
- # line 26 "ragel/i18n/eo.rb.rl"
766
- begin
767
-
768
- @docstring_content_type_start = p
769
- end
770
- when 4 then
771
- # line 29 "ragel/i18n/eo.rb.rl"
772
- begin
773
-
774
- @docstring_content_type_end = p
775
- end
776
- when 5 then
777
- # line 33 "ragel/i18n/eo.rb.rl"
778
- begin
779
-
780
- con = unindent(@start_col, utf8_pack(data[@content_start...@next_keyword_start-1]).sub(/(\r?\n)?([\t ])*\Z/, '').gsub(/\\"\\"\\"/, '"""'))
781
- con_type = utf8_pack(data[@docstring_content_type_start...@docstring_content_type_end]).strip
782
- @listener.doc_string(con_type, con, @current_line)
783
- end
784
- when 6 then
785
- # line 38 "ragel/i18n/eo.rb.rl"
786
- begin
787
-
788
- p = store_keyword_content(:feature, data, p, eof)
789
- end
790
- when 7 then
791
- # line 42 "ragel/i18n/eo.rb.rl"
792
- begin
793
-
794
- p = store_keyword_content(:background, data, p, eof)
795
- end
796
- when 8 then
797
- # line 46 "ragel/i18n/eo.rb.rl"
798
- begin
799
-
800
- p = store_keyword_content(:scenario, data, p, eof)
801
- end
802
- when 9 then
803
- # line 50 "ragel/i18n/eo.rb.rl"
804
- begin
805
-
806
- p = store_keyword_content(:scenario_outline, data, p, eof)
807
- end
808
- when 10 then
809
- # line 54 "ragel/i18n/eo.rb.rl"
810
- begin
811
-
812
- p = store_keyword_content(:examples, data, p, eof)
813
- end
814
- when 11 then
815
- # line 58 "ragel/i18n/eo.rb.rl"
816
- begin
817
-
818
- con = utf8_pack(data[@content_start...p]).strip
819
- @listener.step(@keyword, con, @current_line)
820
- end
821
- when 12 then
822
- # line 63 "ragel/i18n/eo.rb.rl"
823
- begin
824
-
825
- con = utf8_pack(data[@content_start...p]).strip
826
- @listener.comment(con, @line_number)
827
- @keyword_start = nil
828
- end
829
- when 13 then
830
- # line 69 "ragel/i18n/eo.rb.rl"
831
- begin
832
-
833
- con = utf8_pack(data[@content_start...p]).strip
834
- @listener.tag(con, @current_line)
835
- @keyword_start = nil
836
- end
837
- when 14 then
838
- # line 75 "ragel/i18n/eo.rb.rl"
839
- begin
840
-
841
- @line_number += 1
842
- end
843
- when 15 then
844
- # line 79 "ragel/i18n/eo.rb.rl"
845
- begin
846
-
847
- @last_newline = p + 1
848
- end
849
- when 16 then
850
- # line 83 "ragel/i18n/eo.rb.rl"
851
- begin
852
-
853
- @keyword_start ||= p
854
- end
855
- when 17 then
856
- # line 87 "ragel/i18n/eo.rb.rl"
857
- begin
858
-
859
- @keyword = utf8_pack(data[@keyword_start...p]).sub(/:$/,'')
860
- @keyword_start = nil
861
- end
862
- when 18 then
863
- # line 92 "ragel/i18n/eo.rb.rl"
864
- begin
865
-
866
- @next_keyword_start = p
867
- end
868
- when 19 then
869
- # line 96 "ragel/i18n/eo.rb.rl"
870
- begin
871
-
872
- p = p - 1
873
- current_row = []
874
- @current_line = @line_number
875
- end
876
- when 20 then
877
- # line 102 "ragel/i18n/eo.rb.rl"
878
- begin
879
-
880
- @content_start = p
881
- end
882
- when 21 then
883
- # line 106 "ragel/i18n/eo.rb.rl"
884
- begin
885
-
886
- con = utf8_pack(data[@content_start...p]).strip
887
- current_row << con.gsub(/\\\|/, "|").gsub(/\\n/, "\n").gsub(/\\\\/, "\\")
888
- end
889
- when 22 then
890
- # line 111 "ragel/i18n/eo.rb.rl"
891
- begin
892
-
893
- @listener.row(current_row, @current_line)
894
- end
895
- when 23 then
896
- # line 115 "ragel/i18n/eo.rb.rl"
897
- begin
898
-
899
- if cs < lexer_first_final
900
- content = current_line_content(data, p)
901
- 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])
902
- else
903
- @listener.eof
904
- end
905
- end
906
- # line 907 "lib/gherkin/lexer/eo.rb"
907
- end # action switch
908
- end
909
- end
910
- if _trigger_goto
911
- next
912
- end
913
- end
914
- if _goto_level <= _again
915
- if cs == 0
916
- _goto_level = _out
917
- next
918
- end
919
- p += 1
920
- if p != pe
921
- _goto_level = _resume
922
- next
923
- end
924
- end
925
- if _goto_level <= _test_eof
926
- if p == eof
927
- __acts = _lexer_eof_actions[cs]
928
- __nacts = _lexer_actions[__acts]
929
- __acts += 1
930
- while __nacts > 0
931
- __nacts -= 1
932
- __acts += 1
933
- case _lexer_actions[__acts - 1]
934
- when 23 then
935
- # line 115 "ragel/i18n/eo.rb.rl"
936
- begin
937
-
938
- if cs < lexer_first_final
939
- content = current_line_content(data, p)
940
- 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])
941
- else
942
- @listener.eof
943
- end
944
- end
945
- # line 946 "lib/gherkin/lexer/eo.rb"
946
- end # eof action switch
947
- end
948
- if _trigger_goto
949
- next
950
- end
951
- end
952
- end
953
- if _goto_level <= _out
954
- break
955
- end
956
- end
957
- end
958
-
959
- # line 144 "ragel/i18n/eo.rb.rl"
960
- end
961
-
962
- def unindent(startcol, text)
963
- text.gsub(/^[\t ]{0,#{startcol}}/, "")
964
- end
965
-
966
- def store_keyword_content(event, data, p, eof)
967
- end_point = (!@next_keyword_start or (p == eof)) ? p : @next_keyword_start
968
- content = unindent(@start_col + 2, utf8_pack(data[@content_start...end_point])).rstrip
969
- content_lines = content.split("\n")
970
- name = content_lines.shift || ""
971
- name.strip!
972
- description = content_lines.join("\n")
973
- @listener.__send__(event, @keyword, name, description, @current_line)
974
- @next_keyword_start ? @next_keyword_start - 1 : p
975
- ensure
976
- @next_keyword_start = nil
977
- end
978
-
979
- def current_line_content(data, p)
980
- rest = data[@last_newline..-1]
981
- utf8_pack(rest[0..rest.index(10)||-1]).strip # 10 is \n
982
- end
983
-
984
- if (RUBY_VERSION =~ /^1\.9|2\.0/)
985
- def utf8_pack(array)
986
- array.pack("c*").force_encoding("UTF-8")
987
- end
988
- else
989
- def utf8_pack(array)
990
- array.pack("c*")
991
- end
992
- end
993
- end
994
- end
995
- end