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