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