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