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