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