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