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