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_gl")
5
- have_library("c", "main")
6
- create_makefile("gherkin_lexer_gl")
@@ -1,1374 +0,0 @@
1
-
2
- #line 1 "ragel/i18n/gl.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/gl.c.rl"
84
-
85
-
86
- /** Data **/
87
-
88
- #line 89 "ext/gherkin_lexer_gl/gherkin_lexer_gl.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, 17, 18, 19, 35, 36, 37,
114
- 39, 41, 46, 51, 56, 61, 65, 69,
115
- 71, 72, 73, 74, 75, 76, 77, 78,
116
- 79, 80, 81, 82, 83, 84, 85, 86,
117
- 87, 89, 91, 96, 103, 108, 110, 112,
118
- 113, 114, 115, 116, 117, 118, 119, 120,
119
- 121, 122, 123, 124, 125, 126, 127, 128,
120
- 129, 138, 140, 142, 144, 146, 148, 150,
121
- 152, 154, 156, 158, 160, 162, 164, 166,
122
- 169, 171, 173, 175, 177, 179, 181, 183,
123
- 185, 187, 189, 191, 193, 195, 197, 213,
124
- 214, 215, 217, 219, 223, 224, 225, 226,
125
- 227, 229, 230, 231, 232, 233, 234, 235,
126
- 236, 237, 238, 239, 240, 241, 242, 243,
127
- 244, 245, 246, 247, 248, 262, 264, 266,
128
- 268, 270, 272, 274, 276, 278, 280, 282,
129
- 284, 286, 288, 290, 292, 294, 297, 299,
130
- 301, 303, 305, 307, 309, 311, 313, 315,
131
- 317, 319, 321, 323, 325, 327, 329, 331,
132
- 334, 337, 341, 343, 345, 347, 349, 351,
133
- 353, 355, 357, 359, 361, 363, 365, 367,
134
- 369, 371, 373, 375, 377, 378, 379, 380,
135
- 381, 382, 383, 384, 385, 386, 400, 402,
136
- 404, 406, 408, 410, 412, 414, 416, 418,
137
- 420, 422, 424, 426, 428, 430, 433, 436,
138
- 438, 440, 442, 444, 446, 448, 450, 452,
139
- 454, 456, 458, 460, 462, 464, 466, 468,
140
- 470, 472, 474, 476, 478, 480, 482, 485,
141
- 488, 492, 494, 496, 498, 500, 503, 505,
142
- 507, 509, 511, 513, 515, 517, 519, 521,
143
- 523, 525, 527, 529, 531, 533, 535, 537,
144
- 539, 541, 543, 545, 547, 548, 549, 550,
145
- 551, 552, 553, 554, 555, 556, 563, 565,
146
- 567, 569, 571, 573, 575, 577, 579, 581,
147
- 583, 585, 587, 589, 591, 593, 594, 595,
148
- 596, 597, 598, 599, 600, 604, 610, 613,
149
- 615, 621, 637, 639, 641, 643, 645, 647,
150
- 649, 652, 655, 657, 659, 661, 663, 665,
151
- 667, 669, 671, 673, 675, 677, 679, 681,
152
- 683, 685, 687, 689, 691, 693, 695, 697,
153
- 698, 699, 700, 701, 702, 703, 704, 705,
154
- 706, 720, 722, 724, 726, 728, 730, 732,
155
- 734, 736, 738, 740, 742, 744, 746, 748,
156
- 750, 752, 755, 757, 759, 761, 763, 765,
157
- 767, 769, 771, 773, 775, 777, 779, 781,
158
- 783, 785, 787, 789, 792, 795, 799, 801,
159
- 803, 805, 807, 810, 812, 814, 816, 818,
160
- 820, 822, 824, 826, 828, 830, 832, 834,
161
- 836, 838, 840, 842, 844, 846, 848, 850,
162
- 852, 854, 856
163
- };
164
-
165
- static const char _lexer_trans_keys[] = {
166
- -17, 10, 32, 34, 35, 37, 42, 64,
167
- 67, 68, 69, 76, 77, 80, 124, 9,
168
- 13, -69, -65, 10, 32, 34, 35, 37,
169
- 42, 64, 67, 68, 69, 76, 77, 80,
170
- 124, 9, 13, 34, 34, 10, 13, 10,
171
- 13, 10, 32, 34, 9, 13, 10, 32,
172
- 34, 9, 13, 10, 32, 34, 9, 13,
173
- 10, 32, 34, 9, 13, 10, 32, 9,
174
- 13, 10, 32, 9, 13, 10, 13, 10,
175
- 95, 70, 69, 65, 84, 85, 82, 69,
176
- 95, 69, 78, 68, 95, 37, 32, 10,
177
- 13, 10, 13, 13, 32, 64, 9, 10,
178
- 9, 10, 13, 32, 64, 11, 12, 10,
179
- 32, 64, 9, 13, 97, 111, 110, 114,
180
- 100, 111, 97, 99, 116, 101, 114, -61,
181
- -83, 115, 116, 105, 99, 97, 58, 10,
182
- 10, 10, 32, 35, 37, 64, 67, 69,
183
- 9, 13, 10, 95, 10, 70, 10, 69,
184
- 10, 65, 10, 84, 10, 85, 10, 82,
185
- 10, 69, 10, 95, 10, 69, 10, 78,
186
- 10, 68, 10, 95, 10, 37, 10, 97,
187
- 111, 10, 114, 10, 97, 10, 99, 10,
188
- 116, 10, 101, 10, 114, -61, 10, -83,
189
- 10, 10, 115, 10, 116, 10, 105, 10,
190
- 99, 10, 97, 10, 58, 10, 32, 34,
191
- 35, 37, 42, 64, 67, 68, 69, 76,
192
- 77, 80, 124, 9, 13, 97, 100, 97,
193
- 111, 32, 115, 32, 110, 115, 120, 116,
194
- -61, -77, 110, 98, 99, 111, 122, 111,
195
- 32, 100, 111, 32, 101, 115, 99, 101,
196
- 110, 97, 114, 105, 111, 58, 10, 10,
197
- 10, 32, 35, 37, 42, 64, 67, 68,
198
- 69, 76, 77, 80, 9, 13, 10, 95,
199
- 10, 70, 10, 69, 10, 65, 10, 84,
200
- 10, 85, 10, 82, 10, 69, 10, 95,
201
- 10, 69, 10, 78, 10, 68, 10, 95,
202
- 10, 37, 10, 32, 10, 97, 10, 110,
203
- 114, 10, 100, 10, 111, 10, 97, 10,
204
- 99, 10, 116, 10, 101, 10, 114, -61,
205
- 10, -83, 10, 10, 115, 10, 116, 10,
206
- 105, 10, 99, 10, 97, 10, 58, 10,
207
- 97, 10, 100, 10, 97, 111, 10, 32,
208
- 115, 10, 32, 110, 115, 10, 116, -61,
209
- 10, -77, 10, 10, 110, 10, 99, 10,
210
- 101, 10, 110, 10, 97, 10, 114, 10,
211
- 105, 10, 111, 10, 111, 10, 103, 10,
212
- 97, 10, 105, 10, 115, 10, 101, 10,
213
- 114, 101, 110, 97, 114, 105, 111, 58,
214
- 10, 10, 10, 32, 35, 37, 42, 64,
215
- 67, 68, 69, 76, 77, 80, 9, 13,
216
- 10, 95, 10, 70, 10, 69, 10, 65,
217
- 10, 84, 10, 85, 10, 82, 10, 69,
218
- 10, 95, 10, 69, 10, 78, 10, 68,
219
- 10, 95, 10, 37, 10, 32, 10, 97,
220
- 111, 10, 110, 114, 10, 100, 10, 111,
221
- 10, 97, 10, 99, 10, 116, 10, 101,
222
- 10, 114, -61, 10, -83, 10, 10, 115,
223
- 10, 116, 10, 105, 10, 99, 10, 97,
224
- 10, 58, 10, 110, 10, 116, 10, 101,
225
- 10, 120, 10, 116, 10, 111, 10, 97,
226
- 10, 100, 10, 97, 111, 10, 32, 115,
227
- 10, 32, 110, 115, 10, 116, -61, 10,
228
- -77, 10, 10, 110, 10, 98, 99, 10,
229
- 111, 10, 122, 10, 111, 10, 32, 10,
230
- 100, 10, 111, 10, 32, 10, 101, 10,
231
- 115, 10, 99, 10, 101, 10, 110, 10,
232
- 97, 10, 114, 10, 105, 10, 111, 10,
233
- 103, 10, 97, 10, 105, 10, 115, 10,
234
- 101, 10, 114, 101, 109, 112, 108, 111,
235
- 115, 58, 10, 10, 10, 32, 35, 67,
236
- 124, 9, 13, 10, 97, 10, 114, 10,
237
- 97, 10, 99, 10, 116, 10, 101, 10,
238
- 114, -61, 10, -83, 10, 10, 115, 10,
239
- 116, 10, 105, 10, 99, 10, 97, 10,
240
- 58, 111, 103, 97, 105, 115, 101, 114,
241
- 32, 124, 9, 13, 10, 32, 92, 124,
242
- 9, 13, 10, 92, 124, 10, 92, 10,
243
- 32, 92, 124, 9, 13, 10, 32, 34,
244
- 35, 37, 42, 64, 67, 68, 69, 76,
245
- 77, 80, 124, 9, 13, 10, 110, 10,
246
- 116, 10, 101, 10, 120, 10, 116, 10,
247
- 111, 10, 115, 120, 10, 98, 99, 10,
248
- 111, 10, 122, 10, 111, 10, 32, 10,
249
- 100, 10, 111, 10, 32, 10, 101, 10,
250
- 115, 10, 99, 10, 101, 10, 110, 10,
251
- 97, 10, 114, 10, 105, 10, 101, 10,
252
- 109, 10, 112, 10, 108, 10, 111, 10,
253
- 115, 110, 116, 101, 120, 116, 111, 58,
254
- 10, 10, 10, 32, 35, 37, 42, 64,
255
- 67, 68, 69, 76, 77, 80, 9, 13,
256
- 10, 95, 10, 70, 10, 69, 10, 65,
257
- 10, 84, 10, 85, 10, 82, 10, 69,
258
- 10, 95, 10, 69, 10, 78, 10, 68,
259
- 10, 95, 10, 37, 10, 32, 10, 97,
260
- 10, 110, 114, 10, 100, 10, 111, 10,
261
- 97, 10, 99, 10, 116, 10, 101, 10,
262
- 114, -61, 10, -83, 10, 10, 115, 10,
263
- 116, 10, 105, 10, 99, 10, 97, 10,
264
- 58, 10, 97, 10, 100, 10, 97, 111,
265
- 10, 32, 115, 10, 32, 110, 115, 10,
266
- 116, -61, 10, -77, 10, 10, 110, 10,
267
- 98, 99, 10, 111, 10, 122, 10, 111,
268
- 10, 32, 10, 100, 10, 111, 10, 32,
269
- 10, 101, 10, 115, 10, 99, 10, 101,
270
- 10, 110, 10, 97, 10, 114, 10, 105,
271
- 10, 111, 10, 111, 10, 103, 10, 97,
272
- 10, 105, 10, 115, 10, 101, 10, 114,
273
- 0
274
- };
275
-
276
- static const char _lexer_single_lengths[] = {
277
- 0, 15, 1, 1, 14, 1, 1, 2,
278
- 2, 3, 3, 3, 3, 2, 2, 2,
279
- 1, 1, 1, 1, 1, 1, 1, 1,
280
- 1, 1, 1, 1, 1, 1, 1, 1,
281
- 2, 2, 3, 5, 3, 2, 2, 1,
282
- 1, 1, 1, 1, 1, 1, 1, 1,
283
- 1, 1, 1, 1, 1, 1, 1, 1,
284
- 7, 2, 2, 2, 2, 2, 2, 2,
285
- 2, 2, 2, 2, 2, 2, 2, 3,
286
- 2, 2, 2, 2, 2, 2, 2, 2,
287
- 2, 2, 2, 2, 2, 2, 14, 1,
288
- 1, 2, 2, 4, 1, 1, 1, 1,
289
- 2, 1, 1, 1, 1, 1, 1, 1,
290
- 1, 1, 1, 1, 1, 1, 1, 1,
291
- 1, 1, 1, 1, 12, 2, 2, 2,
292
- 2, 2, 2, 2, 2, 2, 2, 2,
293
- 2, 2, 2, 2, 2, 3, 2, 2,
294
- 2, 2, 2, 2, 2, 2, 2, 2,
295
- 2, 2, 2, 2, 2, 2, 2, 3,
296
- 3, 4, 2, 2, 2, 2, 2, 2,
297
- 2, 2, 2, 2, 2, 2, 2, 2,
298
- 2, 2, 2, 2, 1, 1, 1, 1,
299
- 1, 1, 1, 1, 1, 12, 2, 2,
300
- 2, 2, 2, 2, 2, 2, 2, 2,
301
- 2, 2, 2, 2, 2, 3, 3, 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, 3, 3,
305
- 4, 2, 2, 2, 2, 3, 2, 2,
306
- 2, 2, 2, 2, 2, 2, 2, 2,
307
- 2, 2, 2, 2, 2, 2, 2, 2,
308
- 2, 2, 2, 2, 1, 1, 1, 1,
309
- 1, 1, 1, 1, 1, 5, 2, 2,
310
- 2, 2, 2, 2, 2, 2, 2, 2,
311
- 2, 2, 2, 2, 2, 1, 1, 1,
312
- 1, 1, 1, 1, 2, 4, 3, 2,
313
- 4, 14, 2, 2, 2, 2, 2, 2,
314
- 3, 3, 2, 2, 2, 2, 2, 2,
315
- 2, 2, 2, 2, 2, 2, 2, 2,
316
- 2, 2, 2, 2, 2, 2, 2, 1,
317
- 1, 1, 1, 1, 1, 1, 1, 1,
318
- 12, 2, 2, 2, 2, 2, 2, 2,
319
- 2, 2, 2, 2, 2, 2, 2, 2,
320
- 2, 3, 2, 2, 2, 2, 2, 2,
321
- 2, 2, 2, 2, 2, 2, 2, 2,
322
- 2, 2, 2, 3, 3, 4, 2, 2,
323
- 2, 2, 3, 2, 2, 2, 2, 2,
324
- 2, 2, 2, 2, 2, 2, 2, 2,
325
- 2, 2, 2, 2, 2, 2, 2, 2,
326
- 2, 2, 0
327
- };
328
-
329
- static const char _lexer_range_lengths[] = {
330
- 0, 1, 0, 0, 1, 0, 0, 0,
331
- 0, 1, 1, 1, 1, 1, 1, 0,
332
- 0, 0, 0, 0, 0, 0, 0, 0,
333
- 0, 0, 0, 0, 0, 0, 0, 0,
334
- 0, 0, 1, 1, 1, 0, 0, 0,
335
- 0, 0, 0, 0, 0, 0, 0, 0,
336
- 0, 0, 0, 0, 0, 0, 0, 0,
337
- 1, 0, 0, 0, 0, 0, 0, 0,
338
- 0, 0, 0, 0, 0, 0, 0, 0,
339
- 0, 0, 0, 0, 0, 0, 0, 0,
340
- 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 1, 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, 1, 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, 1, 1, 0, 0,
366
- 1, 1, 0, 0, 0, 0, 0, 0,
367
- 0, 0, 0, 0, 0, 0, 0, 0,
368
- 0, 0, 0, 0, 0, 0, 0, 0,
369
- 0, 0, 0, 0, 0, 0, 0, 0,
370
- 0, 0, 0, 0, 0, 0, 0, 0,
371
- 1, 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, 17, 19, 21, 37, 39, 41,
384
- 44, 47, 52, 57, 62, 67, 71, 75,
385
- 78, 80, 82, 84, 86, 88, 90, 92,
386
- 94, 96, 98, 100, 102, 104, 106, 108,
387
- 110, 113, 116, 121, 128, 133, 136, 139,
388
- 141, 143, 145, 147, 149, 151, 153, 155,
389
- 157, 159, 161, 163, 165, 167, 169, 171,
390
- 173, 182, 185, 188, 191, 194, 197, 200,
391
- 203, 206, 209, 212, 215, 218, 221, 224,
392
- 228, 231, 234, 237, 240, 243, 246, 249,
393
- 252, 255, 258, 261, 264, 267, 270, 286,
394
- 288, 290, 293, 296, 301, 303, 305, 307,
395
- 309, 312, 314, 316, 318, 320, 322, 324,
396
- 326, 328, 330, 332, 334, 336, 338, 340,
397
- 342, 344, 346, 348, 350, 364, 367, 370,
398
- 373, 376, 379, 382, 385, 388, 391, 394,
399
- 397, 400, 403, 406, 409, 412, 416, 419,
400
- 422, 425, 428, 431, 434, 437, 440, 443,
401
- 446, 449, 452, 455, 458, 461, 464, 467,
402
- 471, 475, 480, 483, 486, 489, 492, 495,
403
- 498, 501, 504, 507, 510, 513, 516, 519,
404
- 522, 525, 528, 531, 534, 536, 538, 540,
405
- 542, 544, 546, 548, 550, 552, 566, 569,
406
- 572, 575, 578, 581, 584, 587, 590, 593,
407
- 596, 599, 602, 605, 608, 611, 615, 619,
408
- 622, 625, 628, 631, 634, 637, 640, 643,
409
- 646, 649, 652, 655, 658, 661, 664, 667,
410
- 670, 673, 676, 679, 682, 685, 688, 692,
411
- 696, 701, 704, 707, 710, 713, 717, 720,
412
- 723, 726, 729, 732, 735, 738, 741, 744,
413
- 747, 750, 753, 756, 759, 762, 765, 768,
414
- 771, 774, 777, 780, 783, 785, 787, 789,
415
- 791, 793, 795, 797, 799, 801, 808, 811,
416
- 814, 817, 820, 823, 826, 829, 832, 835,
417
- 838, 841, 844, 847, 850, 853, 855, 857,
418
- 859, 861, 863, 865, 867, 871, 877, 881,
419
- 884, 890, 906, 909, 912, 915, 918, 921,
420
- 924, 928, 932, 935, 938, 941, 944, 947,
421
- 950, 953, 956, 959, 962, 965, 968, 971,
422
- 974, 977, 980, 983, 986, 989, 992, 995,
423
- 997, 999, 1001, 1003, 1005, 1007, 1009, 1011,
424
- 1013, 1027, 1030, 1033, 1036, 1039, 1042, 1045,
425
- 1048, 1051, 1054, 1057, 1060, 1063, 1066, 1069,
426
- 1072, 1075, 1079, 1082, 1085, 1088, 1091, 1094,
427
- 1097, 1100, 1103, 1106, 1109, 1112, 1115, 1118,
428
- 1121, 1124, 1127, 1130, 1134, 1138, 1143, 1146,
429
- 1149, 1152, 1155, 1159, 1162, 1165, 1168, 1171,
430
- 1174, 1177, 1180, 1183, 1186, 1189, 1192, 1195,
431
- 1198, 1201, 1204, 1207, 1210, 1213, 1216, 1219,
432
- 1222, 1225, 1228
433
- };
434
-
435
- static const short _lexer_trans_targs[] = {
436
- 2, 4, 4, 5, 15, 17, 31, 34,
437
- 37, 87, 91, 277, 279, 282, 284, 4,
438
- 0, 3, 0, 4, 0, 4, 4, 5,
439
- 15, 17, 31, 34, 37, 87, 91, 277,
440
- 279, 282, 284, 4, 0, 6, 0, 7,
441
- 0, 9, 8, 8, 9, 8, 8, 10,
442
- 10, 11, 10, 10, 10, 10, 11, 10,
443
- 10, 10, 10, 12, 10, 10, 10, 10,
444
- 13, 10, 10, 4, 14, 14, 0, 4,
445
- 14, 14, 0, 4, 16, 15, 4, 0,
446
- 18, 0, 19, 0, 20, 0, 21, 0,
447
- 22, 0, 23, 0, 24, 0, 25, 0,
448
- 26, 0, 27, 0, 28, 0, 29, 0,
449
- 30, 0, 394, 0, 32, 0, 4, 16,
450
- 33, 4, 16, 33, 0, 0, 0, 0,
451
- 35, 36, 4, 36, 36, 34, 35, 35,
452
- 4, 36, 34, 36, 0, 38, 319, 0,
453
- 39, 41, 0, 40, 0, 31, 0, 42,
454
- 0, 43, 0, 44, 0, 45, 0, 46,
455
- 0, 47, 0, 48, 0, 49, 0, 50,
456
- 0, 51, 0, 52, 0, 53, 0, 54,
457
- 0, 56, 55, 56, 55, 56, 56, 4,
458
- 57, 4, 71, 296, 56, 55, 56, 58,
459
- 55, 56, 59, 55, 56, 60, 55, 56,
460
- 61, 55, 56, 62, 55, 56, 63, 55,
461
- 56, 64, 55, 56, 65, 55, 56, 66,
462
- 55, 56, 67, 55, 56, 68, 55, 56,
463
- 69, 55, 56, 70, 55, 56, 4, 55,
464
- 56, 72, 290, 55, 56, 73, 55, 56,
465
- 74, 55, 56, 75, 55, 56, 76, 55,
466
- 56, 77, 55, 56, 78, 55, 79, 56,
467
- 55, 80, 56, 55, 56, 81, 55, 56,
468
- 82, 55, 56, 83, 55, 56, 84, 55,
469
- 56, 85, 55, 56, 86, 55, 4, 4,
470
- 5, 15, 17, 31, 34, 37, 87, 91,
471
- 277, 279, 282, 284, 4, 0, 88, 0,
472
- 89, 0, 90, 90, 0, 32, 31, 0,
473
- 32, 92, 96, 252, 0, 93, 0, 94,
474
- 0, 95, 0, 31, 0, 97, 172, 0,
475
- 98, 0, 99, 0, 100, 0, 101, 0,
476
- 102, 0, 103, 0, 104, 0, 105, 0,
477
- 106, 0, 107, 0, 108, 0, 109, 0,
478
- 110, 0, 111, 0, 112, 0, 113, 0,
479
- 114, 0, 116, 115, 116, 115, 116, 116,
480
- 4, 117, 131, 4, 132, 149, 153, 165,
481
- 167, 170, 116, 115, 116, 118, 115, 116,
482
- 119, 115, 116, 120, 115, 116, 121, 115,
483
- 116, 122, 115, 116, 123, 115, 116, 124,
484
- 115, 116, 125, 115, 116, 126, 115, 116,
485
- 127, 115, 116, 128, 115, 116, 129, 115,
486
- 116, 130, 115, 116, 4, 115, 116, 86,
487
- 115, 116, 133, 115, 116, 134, 136, 115,
488
- 116, 135, 115, 116, 131, 115, 116, 137,
489
- 115, 116, 138, 115, 116, 139, 115, 116,
490
- 140, 115, 116, 141, 115, 142, 116, 115,
491
- 143, 116, 115, 116, 144, 115, 116, 145,
492
- 115, 116, 146, 115, 116, 147, 115, 116,
493
- 148, 115, 116, 86, 115, 116, 150, 115,
494
- 116, 151, 115, 116, 152, 152, 115, 116,
495
- 86, 131, 115, 116, 86, 154, 158, 115,
496
- 116, 155, 115, 156, 116, 115, 157, 116,
497
- 115, 116, 131, 115, 116, 159, 115, 116,
498
- 160, 115, 116, 161, 115, 116, 162, 115,
499
- 116, 163, 115, 116, 164, 115, 116, 148,
500
- 115, 116, 166, 115, 116, 135, 115, 116,
501
- 168, 115, 116, 169, 115, 116, 131, 115,
502
- 116, 171, 115, 116, 135, 115, 173, 0,
503
- 174, 0, 175, 0, 176, 0, 177, 0,
504
- 178, 0, 179, 0, 181, 180, 181, 180,
505
- 181, 181, 4, 182, 196, 4, 197, 220,
506
- 224, 245, 247, 250, 181, 180, 181, 183,
507
- 180, 181, 184, 180, 181, 185, 180, 181,
508
- 186, 180, 181, 187, 180, 181, 188, 180,
509
- 181, 189, 180, 181, 190, 180, 181, 191,
510
- 180, 181, 192, 180, 181, 193, 180, 181,
511
- 194, 180, 181, 195, 180, 181, 4, 180,
512
- 181, 86, 180, 181, 198, 214, 180, 181,
513
- 199, 201, 180, 181, 200, 180, 181, 196,
514
- 180, 181, 202, 180, 181, 203, 180, 181,
515
- 204, 180, 181, 205, 180, 181, 206, 180,
516
- 207, 181, 180, 208, 181, 180, 181, 209,
517
- 180, 181, 210, 180, 181, 211, 180, 181,
518
- 212, 180, 181, 213, 180, 181, 86, 180,
519
- 181, 215, 180, 181, 216, 180, 181, 217,
520
- 180, 181, 218, 180, 181, 219, 180, 181,
521
- 213, 180, 181, 221, 180, 181, 222, 180,
522
- 181, 223, 223, 180, 181, 86, 196, 180,
523
- 181, 86, 225, 229, 180, 181, 226, 180,
524
- 227, 181, 180, 228, 181, 180, 181, 196,
525
- 180, 181, 230, 240, 180, 181, 231, 180,
526
- 181, 232, 180, 181, 233, 180, 181, 234,
527
- 180, 181, 235, 180, 181, 236, 180, 181,
528
- 237, 180, 181, 238, 180, 181, 239, 180,
529
- 181, 240, 180, 181, 241, 180, 181, 242,
530
- 180, 181, 243, 180, 181, 244, 180, 181,
531
- 219, 180, 181, 246, 180, 181, 200, 180,
532
- 181, 248, 180, 181, 249, 180, 181, 196,
533
- 180, 181, 251, 180, 181, 200, 180, 253,
534
- 0, 254, 0, 255, 0, 256, 0, 257,
535
- 0, 258, 0, 259, 0, 261, 260, 261,
536
- 260, 261, 261, 4, 262, 4, 261, 260,
537
- 261, 263, 260, 261, 264, 260, 261, 265,
538
- 260, 261, 266, 260, 261, 267, 260, 261,
539
- 268, 260, 261, 269, 260, 270, 261, 260,
540
- 271, 261, 260, 261, 272, 260, 261, 273,
541
- 260, 261, 274, 260, 261, 275, 260, 261,
542
- 276, 260, 261, 86, 260, 278, 0, 40,
543
- 0, 280, 0, 281, 0, 31, 0, 283,
544
- 0, 40, 0, 284, 285, 284, 0, 289,
545
- 288, 287, 285, 288, 286, 0, 287, 285,
546
- 286, 0, 287, 286, 289, 288, 287, 285,
547
- 288, 286, 289, 289, 5, 15, 17, 31,
548
- 34, 37, 87, 91, 277, 279, 282, 284,
549
- 289, 0, 56, 291, 55, 56, 292, 55,
550
- 56, 293, 55, 56, 294, 55, 56, 295,
551
- 55, 56, 85, 55, 56, 297, 313, 55,
552
- 56, 298, 308, 55, 56, 299, 55, 56,
553
- 300, 55, 56, 301, 55, 56, 302, 55,
554
- 56, 303, 55, 56, 304, 55, 56, 305,
555
- 55, 56, 306, 55, 56, 307, 55, 56,
556
- 308, 55, 56, 309, 55, 56, 310, 55,
557
- 56, 311, 55, 56, 312, 55, 56, 295,
558
- 55, 56, 314, 55, 56, 315, 55, 56,
559
- 316, 55, 56, 317, 55, 56, 318, 55,
560
- 56, 85, 55, 320, 0, 321, 0, 322,
561
- 0, 323, 0, 324, 0, 325, 0, 326,
562
- 0, 328, 327, 328, 327, 328, 328, 4,
563
- 329, 343, 4, 344, 361, 365, 387, 389,
564
- 392, 328, 327, 328, 330, 327, 328, 331,
565
- 327, 328, 332, 327, 328, 333, 327, 328,
566
- 334, 327, 328, 335, 327, 328, 336, 327,
567
- 328, 337, 327, 328, 338, 327, 328, 339,
568
- 327, 328, 340, 327, 328, 341, 327, 328,
569
- 342, 327, 328, 4, 327, 328, 86, 327,
570
- 328, 345, 327, 328, 346, 348, 327, 328,
571
- 347, 327, 328, 343, 327, 328, 349, 327,
572
- 328, 350, 327, 328, 351, 327, 328, 352,
573
- 327, 328, 353, 327, 354, 328, 327, 355,
574
- 328, 327, 328, 356, 327, 328, 357, 327,
575
- 328, 358, 327, 328, 359, 327, 328, 360,
576
- 327, 328, 86, 327, 328, 362, 327, 328,
577
- 363, 327, 328, 364, 364, 327, 328, 86,
578
- 343, 327, 328, 86, 366, 370, 327, 328,
579
- 367, 327, 368, 328, 327, 369, 328, 327,
580
- 328, 343, 327, 328, 371, 381, 327, 328,
581
- 372, 327, 328, 373, 327, 328, 374, 327,
582
- 328, 375, 327, 328, 376, 327, 328, 377,
583
- 327, 328, 378, 327, 328, 379, 327, 328,
584
- 380, 327, 328, 381, 327, 328, 382, 327,
585
- 328, 383, 327, 328, 384, 327, 328, 385,
586
- 327, 328, 386, 327, 328, 360, 327, 328,
587
- 388, 327, 328, 347, 327, 328, 390, 327,
588
- 328, 391, 327, 328, 343, 327, 328, 393,
589
- 327, 328, 347, 327, 0, 0
590
- };
591
-
592
- static const unsigned char _lexer_trans_actions[] = {
593
- 0, 54, 0, 5, 1, 0, 29, 1,
594
- 29, 29, 29, 29, 29, 29, 35, 0,
595
- 43, 0, 43, 0, 43, 54, 0, 5,
596
- 1, 0, 29, 1, 29, 29, 29, 29,
597
- 29, 29, 35, 0, 43, 0, 43, 0,
598
- 43, 139, 48, 9, 106, 11, 0, 134,
599
- 45, 45, 45, 3, 122, 33, 33, 33,
600
- 0, 122, 33, 33, 33, 0, 122, 33,
601
- 0, 33, 0, 102, 7, 7, 43, 54,
602
- 0, 0, 43, 114, 25, 0, 54, 43,
603
- 0, 43, 0, 43, 0, 43, 0, 43,
604
- 0, 43, 0, 43, 0, 43, 0, 43,
605
- 0, 43, 0, 43, 0, 43, 0, 43,
606
- 0, 43, 0, 43, 0, 43, 149, 126,
607
- 57, 110, 23, 0, 43, 43, 43, 43,
608
- 0, 27, 118, 27, 27, 51, 27, 0,
609
- 54, 0, 1, 0, 43, 0, 0, 43,
610
- 0, 0, 43, 0, 43, 0, 43, 0,
611
- 43, 0, 43, 0, 43, 0, 43, 0,
612
- 43, 0, 43, 0, 43, 0, 43, 0,
613
- 43, 0, 43, 0, 43, 0, 43, 0,
614
- 43, 144, 57, 54, 0, 54, 0, 69,
615
- 33, 69, 84, 84, 0, 0, 54, 0,
616
- 0, 54, 0, 0, 54, 0, 0, 54,
617
- 0, 0, 54, 0, 0, 54, 0, 0,
618
- 54, 0, 0, 54, 0, 0, 54, 0,
619
- 0, 54, 0, 0, 54, 0, 0, 54,
620
- 0, 0, 54, 0, 0, 54, 13, 0,
621
- 54, 0, 0, 0, 54, 0, 0, 54,
622
- 0, 0, 54, 0, 0, 54, 0, 0,
623
- 54, 0, 0, 54, 0, 0, 0, 54,
624
- 0, 0, 54, 0, 54, 0, 0, 54,
625
- 0, 0, 54, 0, 0, 54, 0, 0,
626
- 54, 0, 0, 54, 13, 0, 130, 31,
627
- 60, 57, 31, 63, 57, 63, 63, 63,
628
- 63, 63, 63, 66, 31, 43, 0, 43,
629
- 0, 43, 0, 0, 43, 0, 0, 43,
630
- 0, 0, 0, 0, 43, 0, 43, 0,
631
- 43, 0, 43, 0, 43, 0, 0, 43,
632
- 0, 43, 0, 43, 0, 43, 0, 43,
633
- 0, 43, 0, 43, 0, 43, 0, 43,
634
- 0, 43, 0, 43, 0, 43, 0, 43,
635
- 0, 43, 0, 43, 0, 43, 0, 43,
636
- 0, 43, 144, 57, 54, 0, 54, 0,
637
- 78, 33, 84, 78, 84, 84, 84, 84,
638
- 84, 84, 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, 54, 0, 0, 54, 0, 0, 54,
642
- 0, 0, 54, 0, 0, 54, 0, 0,
643
- 54, 0, 0, 54, 19, 0, 54, 19,
644
- 0, 54, 0, 0, 54, 0, 0, 0,
645
- 54, 0, 0, 54, 0, 0, 54, 0,
646
- 0, 54, 0, 0, 54, 0, 0, 54,
647
- 0, 0, 54, 0, 0, 0, 54, 0,
648
- 0, 54, 0, 54, 0, 0, 54, 0,
649
- 0, 54, 0, 0, 54, 0, 0, 54,
650
- 0, 0, 54, 19, 0, 54, 0, 0,
651
- 54, 0, 0, 54, 0, 0, 0, 54,
652
- 19, 0, 0, 54, 19, 0, 0, 0,
653
- 54, 0, 0, 0, 54, 0, 0, 54,
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, 0, 0,
659
- 54, 0, 0, 54, 0, 0, 0, 43,
660
- 0, 43, 0, 43, 0, 43, 0, 43,
661
- 0, 43, 0, 43, 144, 57, 54, 0,
662
- 54, 0, 75, 33, 84, 75, 84, 84,
663
- 84, 84, 84, 84, 0, 0, 54, 0,
664
- 0, 54, 0, 0, 54, 0, 0, 54,
665
- 0, 0, 54, 0, 0, 54, 0, 0,
666
- 54, 0, 0, 54, 0, 0, 54, 0,
667
- 0, 54, 0, 0, 54, 0, 0, 54,
668
- 0, 0, 54, 0, 0, 54, 17, 0,
669
- 54, 17, 0, 54, 0, 0, 0, 54,
670
- 0, 0, 0, 54, 0, 0, 54, 0,
671
- 0, 54, 0, 0, 54, 0, 0, 54,
672
- 0, 0, 54, 0, 0, 54, 0, 0,
673
- 0, 54, 0, 0, 54, 0, 54, 0,
674
- 0, 54, 0, 0, 54, 0, 0, 54,
675
- 0, 0, 54, 0, 0, 54, 17, 0,
676
- 54, 0, 0, 54, 0, 0, 54, 0,
677
- 0, 54, 0, 0, 54, 0, 0, 54,
678
- 0, 0, 54, 0, 0, 54, 0, 0,
679
- 54, 0, 0, 0, 54, 17, 0, 0,
680
- 54, 17, 0, 0, 0, 54, 0, 0,
681
- 0, 54, 0, 0, 54, 0, 54, 0,
682
- 0, 54, 0, 0, 0, 54, 0, 0,
683
- 54, 0, 0, 54, 0, 0, 54, 0,
684
- 0, 54, 0, 0, 54, 0, 0, 54,
685
- 0, 0, 54, 0, 0, 54, 0, 0,
686
- 54, 0, 0, 54, 0, 0, 54, 0,
687
- 0, 54, 0, 0, 54, 0, 0, 54,
688
- 0, 0, 54, 0, 0, 54, 0, 0,
689
- 54, 0, 0, 54, 0, 0, 54, 0,
690
- 0, 54, 0, 0, 54, 0, 0, 0,
691
- 43, 0, 43, 0, 43, 0, 43, 0,
692
- 43, 0, 43, 0, 43, 144, 57, 54,
693
- 0, 54, 0, 81, 84, 81, 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, 0, 0, 54, 0,
697
- 0, 54, 0, 54, 0, 0, 54, 0,
698
- 0, 54, 0, 0, 54, 0, 0, 54,
699
- 0, 0, 54, 21, 0, 0, 43, 0,
700
- 43, 0, 43, 0, 43, 0, 43, 0,
701
- 43, 0, 43, 0, 0, 0, 43, 54,
702
- 37, 37, 87, 37, 37, 43, 0, 39,
703
- 0, 43, 0, 0, 54, 0, 0, 39,
704
- 0, 0, 54, 0, 93, 90, 41, 96,
705
- 90, 96, 96, 96, 96, 96, 96, 99,
706
- 0, 43, 54, 0, 0, 54, 0, 0,
707
- 54, 0, 0, 54, 0, 0, 54, 0,
708
- 0, 54, 0, 0, 54, 0, 0, 0,
709
- 54, 0, 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
- 0, 0, 54, 0, 0, 54, 0, 0,
714
- 54, 0, 0, 54, 0, 0, 54, 0,
715
- 0, 54, 0, 0, 54, 0, 0, 54,
716
- 0, 0, 54, 0, 0, 54, 0, 0,
717
- 54, 0, 0, 0, 43, 0, 43, 0,
718
- 43, 0, 43, 0, 43, 0, 43, 0,
719
- 43, 144, 57, 54, 0, 54, 0, 72,
720
- 33, 84, 72, 84, 84, 84, 84, 84,
721
- 84, 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, 15, 0, 54, 15, 0,
727
- 54, 0, 0, 54, 0, 0, 0, 54,
728
- 0, 0, 54, 0, 0, 54, 0, 0,
729
- 54, 0, 0, 54, 0, 0, 54, 0,
730
- 0, 54, 0, 0, 0, 54, 0, 0,
731
- 54, 0, 54, 0, 0, 54, 0, 0,
732
- 54, 0, 0, 54, 0, 0, 54, 0,
733
- 0, 54, 15, 0, 54, 0, 0, 54,
734
- 0, 0, 54, 0, 0, 0, 54, 15,
735
- 0, 0, 54, 15, 0, 0, 0, 54,
736
- 0, 0, 0, 54, 0, 0, 54, 0,
737
- 54, 0, 0, 54, 0, 0, 0, 54,
738
- 0, 0, 54, 0, 0, 54, 0, 0,
739
- 54, 0, 0, 54, 0, 0, 54, 0,
740
- 0, 54, 0, 0, 54, 0, 0, 54,
741
- 0, 0, 54, 0, 0, 54, 0, 0,
742
- 54, 0, 0, 54, 0, 0, 54, 0,
743
- 0, 54, 0, 0, 54, 0, 0, 54,
744
- 0, 0, 54, 0, 0, 54, 0, 0,
745
- 54, 0, 0, 54, 0, 0, 54, 0,
746
- 0, 54, 0, 0, 0, 0
747
- };
748
-
749
- static const unsigned char _lexer_eof_actions[] = {
750
- 0, 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 = 394;
804
- static const int lexer_error = 0;
805
-
806
- static const int lexer_en_main = 1;
807
-
808
-
809
- #line 258 "ragel/i18n/gl.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_gl/gherkin_lexer_gl.c"
978
- {
979
- cs = lexer_start;
980
- }
981
-
982
- #line 425 "ragel/i18n/gl.c.rl"
983
-
984
- #line 985 "ext/gherkin_lexer_gl/gherkin_lexer_gl.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/gl.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/gl.c.rl"
1067
- {
1068
- MARK(content_start, p);
1069
- }
1070
- break;
1071
- case 2:
1072
- #line 93 "ragel/i18n/gl.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/gl.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/gl.c.rl"
1092
- {
1093
- MARK(docstring_content_type_start, p);
1094
- }
1095
- break;
1096
- case 5:
1097
- #line 112 "ragel/i18n/gl.c.rl"
1098
- {
1099
- MARK(docstring_content_type_end, p);
1100
- }
1101
- break;
1102
- case 6:
1103
- #line 116 "ragel/i18n/gl.c.rl"
1104
- {
1105
- STORE_KW_END_CON(feature);
1106
- }
1107
- break;
1108
- case 7:
1109
- #line 120 "ragel/i18n/gl.c.rl"
1110
- {
1111
- STORE_KW_END_CON(background);
1112
- }
1113
- break;
1114
- case 8:
1115
- #line 124 "ragel/i18n/gl.c.rl"
1116
- {
1117
- STORE_KW_END_CON(scenario);
1118
- }
1119
- break;
1120
- case 9:
1121
- #line 128 "ragel/i18n/gl.c.rl"
1122
- {
1123
- STORE_KW_END_CON(scenario_outline);
1124
- }
1125
- break;
1126
- case 10:
1127
- #line 132 "ragel/i18n/gl.c.rl"
1128
- {
1129
- STORE_KW_END_CON(examples);
1130
- }
1131
- break;
1132
- case 11:
1133
- #line 136 "ragel/i18n/gl.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/gl.c.rl"
1143
- {
1144
- STORE_ATTR(comment);
1145
- lexer->mark = 0;
1146
- }
1147
- break;
1148
- case 13:
1149
- #line 148 "ragel/i18n/gl.c.rl"
1150
- {
1151
- STORE_ATTR(tag);
1152
- lexer->mark = 0;
1153
- }
1154
- break;
1155
- case 14:
1156
- #line 153 "ragel/i18n/gl.c.rl"
1157
- {
1158
- lexer->line_number += 1;
1159
- MARK(final_newline, p);
1160
- }
1161
- break;
1162
- case 15:
1163
- #line 158 "ragel/i18n/gl.c.rl"
1164
- {
1165
- MARK(last_newline, p + 1);
1166
- }
1167
- break;
1168
- case 16:
1169
- #line 162 "ragel/i18n/gl.c.rl"
1170
- {
1171
- if (lexer->mark == 0) {
1172
- MARK(mark, p);
1173
- }
1174
- }
1175
- break;
1176
- case 17:
1177
- #line 168 "ragel/i18n/gl.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/gl.c.rl"
1187
- {
1188
- MARK(content_end, p);
1189
- }
1190
- break;
1191
- case 19:
1192
- #line 179 "ragel/i18n/gl.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/gl.c.rl"
1201
- {
1202
- MARK(content_start, p);
1203
- }
1204
- break;
1205
- case 21:
1206
- #line 189 "ragel/i18n/gl.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/gl.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/gl.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_gl/gherkin_lexer_gl.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/gl.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_gl/gherkin_lexer_gl.c"
1338
- }
1339
- }
1340
- }
1341
-
1342
- _out: {}
1343
- }
1344
-
1345
- #line 426 "ragel/i18n/gl.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_gl()
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, "Gl", 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
-