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