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