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