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