kbaum-cucumber 0.4.5.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (511) hide show
  1. data/.gitattributes +1 -0
  2. data/.gitignore +18 -0
  3. data/Caliper.yml +5 -0
  4. data/History.txt +1292 -0
  5. data/LICENSE +22 -0
  6. data/README.rdoc +26 -0
  7. data/Rakefile +63 -0
  8. data/VERSION.yml +5 -0
  9. data/bin/cucumber +16 -0
  10. data/cucumber.gemspec +741 -0
  11. data/cucumber.yml +10 -0
  12. data/examples/dos_line_endings/Rakefile +6 -0
  13. data/examples/dos_line_endings/features/dos_line_endings.feature +9 -0
  14. data/examples/i18n/README.textile +18 -0
  15. data/examples/i18n/Rakefile +32 -0
  16. data/examples/i18n/ar/Rakefile +6 -0
  17. data/examples/i18n/ar/features/addition.feature +17 -0
  18. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +24 -0
  19. data/examples/i18n/ar/lib/calculator.rb +11 -0
  20. data/examples/i18n/bg/Rakefile +6 -0
  21. data/examples/i18n/bg/features/addition.feature +12 -0
  22. data/examples/i18n/bg/features/consecutive_calculations.feature +19 -0
  23. data/examples/i18n/bg/features/division.feature +17 -0
  24. data/examples/i18n/bg/features/step_definitons/calculator_steps.rb +24 -0
  25. data/examples/i18n/bg/features/support/env.rb +6 -0
  26. data/examples/i18n/bg/features/support/world.rb +8 -0
  27. data/examples/i18n/bg/lib/calculator.rb +24 -0
  28. data/examples/i18n/cat/Rakefile +6 -0
  29. data/examples/i18n/cat/features/step_definitons/calculator_steps.rb +21 -0
  30. data/examples/i18n/cat/features/suma.feature +17 -0
  31. data/examples/i18n/cat/lib/calculadora.rb +16 -0
  32. data/examples/i18n/da/Rakefile +6 -0
  33. data/examples/i18n/da/features/sammenlaegning.feature +18 -0
  34. data/examples/i18n/da/features/step_definitons/lommeregner_steps.rb +24 -0
  35. data/examples/i18n/da/lib/lommeregner.rb +11 -0
  36. data/examples/i18n/de/.gitignore +1 -0
  37. data/examples/i18n/de/Rakefile +6 -0
  38. data/examples/i18n/de/features/addition.feature +17 -0
  39. data/examples/i18n/de/features/division.feature +10 -0
  40. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +24 -0
  41. data/examples/i18n/de/lib/calculator.rb +14 -0
  42. data/examples/i18n/en-lol/Rakefile +4 -0
  43. data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +16 -0
  44. data/examples/i18n/en-lol/features/stuffing.feature +8 -0
  45. data/examples/i18n/en-lol/features/support/env.rb +8 -0
  46. data/examples/i18n/en-lol/lib/basket.rb +12 -0
  47. data/examples/i18n/en-lol/lib/belly.rb +11 -0
  48. data/examples/i18n/en/.gitignore +1 -0
  49. data/examples/i18n/en/Rakefile +6 -0
  50. data/examples/i18n/en/features/addition.feature +17 -0
  51. data/examples/i18n/en/features/division.feature +10 -0
  52. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +24 -0
  53. data/examples/i18n/en/lib/calculator.rb +14 -0
  54. data/examples/i18n/es/Rakefile +6 -0
  55. data/examples/i18n/es/features/adicion.feature +17 -0
  56. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +21 -0
  57. data/examples/i18n/es/lib/calculador.rb +14 -0
  58. data/examples/i18n/et/Rakefile +6 -0
  59. data/examples/i18n/et/features/jagamine.feature +10 -0
  60. data/examples/i18n/et/features/liitmine.feature +17 -0
  61. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +24 -0
  62. data/examples/i18n/et/lib/kalkulaator.rb +14 -0
  63. data/examples/i18n/fi/.gitignore +1 -0
  64. data/examples/i18n/fi/Rakefile +6 -0
  65. data/examples/i18n/fi/features/jakolasku.feature +10 -0
  66. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +24 -0
  67. data/examples/i18n/fi/features/yhteenlasku.feature +17 -0
  68. data/examples/i18n/fi/lib/laskin.rb +14 -0
  69. data/examples/i18n/fr/Rakefile +6 -0
  70. data/examples/i18n/fr/features/addition.feature +18 -0
  71. data/examples/i18n/fr/features/addition2.feature +17 -0
  72. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +38 -0
  73. data/examples/i18n/fr/lib/calculatrice.rb +10 -0
  74. data/examples/i18n/he/Rakefile +6 -0
  75. data/examples/i18n/he/features/addition.feature +17 -0
  76. data/examples/i18n/he/features/division.feature +10 -0
  77. data/examples/i18n/he/features/step_definitons/calculator_steps.rb +24 -0
  78. data/examples/i18n/he/lib/calculator.rb +14 -0
  79. data/examples/i18n/hu/.gitignore +1 -0
  80. data/examples/i18n/hu/Rakefile +6 -0
  81. data/examples/i18n/hu/features/addition.feature +17 -0
  82. data/examples/i18n/hu/features/division.feature +10 -0
  83. data/examples/i18n/hu/features/step_definitons/calculator_steps.rb +25 -0
  84. data/examples/i18n/hu/lib/calculator.rb +14 -0
  85. data/examples/i18n/id/.gitignore +1 -0
  86. data/examples/i18n/id/Rakefile +6 -0
  87. data/examples/i18n/id/features/addition.feature +17 -0
  88. data/examples/i18n/id/features/division.feature +10 -0
  89. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +24 -0
  90. data/examples/i18n/id/lib/calculator.rb +14 -0
  91. data/examples/i18n/it/Rakefile +6 -0
  92. data/examples/i18n/it/features/somma.feature +11 -0
  93. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +24 -0
  94. data/examples/i18n/it/lib/calcolatrice.rb +11 -0
  95. data/examples/i18n/ja/.gitignore +1 -0
  96. data/examples/i18n/ja/Rakefile +6 -0
  97. data/examples/i18n/ja/features/addition.feature +17 -0
  98. data/examples/i18n/ja/features/division.feature +10 -0
  99. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +24 -0
  100. data/examples/i18n/ja/lib/calculator.rb +14 -0
  101. data/examples/i18n/ko/.gitignore +1 -0
  102. data/examples/i18n/ko/Rakefile +6 -0
  103. data/examples/i18n/ko/features/addition.feature +17 -0
  104. data/examples/i18n/ko/features/division.feature +11 -0
  105. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +24 -0
  106. data/examples/i18n/ko/lib/calculator.rb +14 -0
  107. data/examples/i18n/lt/.gitignore +1 -0
  108. data/examples/i18n/lt/Rakefile +6 -0
  109. data/examples/i18n/lt/features/addition.feature +17 -0
  110. data/examples/i18n/lt/features/division.feature +10 -0
  111. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +24 -0
  112. data/examples/i18n/lt/lib/calculator.rb +14 -0
  113. data/examples/i18n/lv/Rakefile +6 -0
  114. data/examples/i18n/lv/features/addition.feature +17 -0
  115. data/examples/i18n/lv/features/division.feature +10 -0
  116. data/examples/i18n/lv/features/step_definitons/calculator_steps.rb +24 -0
  117. data/examples/i18n/lv/lib/calculator.rb +14 -0
  118. data/examples/i18n/no/Rakefile +6 -0
  119. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +17 -0
  120. data/examples/i18n/no/features/summering.feature +19 -0
  121. data/examples/i18n/no/features/support/env.rb +6 -0
  122. data/examples/i18n/no/lib/kalkulator.rb +11 -0
  123. data/examples/i18n/pl/.gitignore +1 -0
  124. data/examples/i18n/pl/Rakefile +6 -0
  125. data/examples/i18n/pl/features/addition.feature +17 -0
  126. data/examples/i18n/pl/features/division.feature +10 -0
  127. data/examples/i18n/pl/features/step_definitons/calculator_steps.rb +24 -0
  128. data/examples/i18n/pl/features/support/env.rb +6 -0
  129. data/examples/i18n/pl/lib/calculator.rb +14 -0
  130. data/examples/i18n/pt/Rakefile +6 -0
  131. data/examples/i18n/pt/features/adicao.feature +11 -0
  132. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +20 -0
  133. data/examples/i18n/pt/features/support/env.rb +6 -0
  134. data/examples/i18n/pt/lib/calculadora.rb +10 -0
  135. data/examples/i18n/ro/Rakefile +6 -0
  136. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +24 -0
  137. data/examples/i18n/ro/features/suma.feature +11 -0
  138. data/examples/i18n/ro/lib/calculator.rb +11 -0
  139. data/examples/i18n/ru/Rakefile +6 -0
  140. data/examples/i18n/ru/features/addition.feature +11 -0
  141. data/examples/i18n/ru/features/consecutive_calculations.feature +17 -0
  142. data/examples/i18n/ru/features/division.feature +16 -0
  143. data/examples/i18n/ru/features/step_definitons/calculator_steps.rb +19 -0
  144. data/examples/i18n/ru/features/support/env.rb +6 -0
  145. data/examples/i18n/ru/features/support/world.rb +8 -0
  146. data/examples/i18n/ru/lib/calculator.rb +24 -0
  147. data/examples/i18n/se/Rakefile +6 -0
  148. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +24 -0
  149. data/examples/i18n/se/features/summering.feature +18 -0
  150. data/examples/i18n/se/lib/kalkulator.rb +11 -0
  151. data/examples/i18n/sk/.gitignore +1 -0
  152. data/examples/i18n/sk/Rakefile +6 -0
  153. data/examples/i18n/sk/features/addition.feature +17 -0
  154. data/examples/i18n/sk/features/division.feature +10 -0
  155. data/examples/i18n/sk/features/step_definitons/calculator_steps.rb +24 -0
  156. data/examples/i18n/sk/lib/calculator.rb +14 -0
  157. data/examples/i18n/sr-latn/Rakefile +6 -0
  158. data/examples/i18n/sr-latn/features/sabiranje.feature +18 -0
  159. data/examples/i18n/sr-latn/features/step_definitons/calculator_steps.rb +24 -0
  160. data/examples/i18n/sr-latn/lib/calculator.rb +12 -0
  161. data/examples/i18n/sr/Rakefile +6 -0
  162. data/examples/i18n/sr/features/sabiranje.feature +18 -0
  163. data/examples/i18n/sr/features/step_definitons/calculator_steps.rb +24 -0
  164. data/examples/i18n/sr/lib/calculator.rb +12 -0
  165. data/examples/i18n/tr/.gitignore +1 -0
  166. data/examples/i18n/tr/Rakefile +6 -0
  167. data/examples/i18n/tr/features/bolme.feature +10 -0
  168. data/examples/i18n/tr/features/step_definitons/hesap_makinesi_adimlari.rb +24 -0
  169. data/examples/i18n/tr/features/toplama.feature +18 -0
  170. data/examples/i18n/tr/lib/hesap_makinesi.rb +15 -0
  171. data/examples/i18n/uz/Rakefile +6 -0
  172. data/examples/i18n/uz/features/addition.feature +10 -0
  173. data/examples/i18n/uz/features/consecutive_calculations.feature +17 -0
  174. data/examples/i18n/uz/features/division.feature +17 -0
  175. data/examples/i18n/uz/features/step_definitons/calculator_steps.rb +19 -0
  176. data/examples/i18n/uz/features/support/env.rb +6 -0
  177. data/examples/i18n/uz/features/support/world.rb +8 -0
  178. data/examples/i18n/uz/lib/calculator.rb +24 -0
  179. data/examples/i18n/zh-CN/Rakefile +4 -0
  180. data/examples/i18n/zh-CN/features/addition.feature +18 -0
  181. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +26 -0
  182. data/examples/i18n/zh-CN/lib/calculator.rb +10 -0
  183. data/examples/i18n/zh-TW/.gitignore +1 -0
  184. data/examples/i18n/zh-TW/Rakefile +4 -0
  185. data/examples/i18n/zh-TW/features/addition.feature +17 -0
  186. data/examples/i18n/zh-TW/features/division.feature +11 -0
  187. data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +24 -0
  188. data/examples/i18n/zh-TW/lib/calculator.rb +14 -0
  189. data/examples/junit/features/one_passing_one_failing.feature +8 -0
  190. data/examples/junit/features/pending.feature +5 -0
  191. data/examples/junit/features/step_definitions/steps.rb +11 -0
  192. data/examples/python/features/fibonacci.feature +19 -0
  193. data/examples/python/features/step_definitions/fib_steps.py +11 -0
  194. data/examples/python/lib/.gitignore +1 -0
  195. data/examples/python/lib/fib.py +7 -0
  196. data/examples/ramaze/README.textile +7 -0
  197. data/examples/ramaze/Rakefile +6 -0
  198. data/examples/ramaze/app.rb +21 -0
  199. data/examples/ramaze/features/add.feature +11 -0
  200. data/examples/ramaze/features/step_definitions/add_steps.rb +15 -0
  201. data/examples/ramaze/features/support/env.rb +32 -0
  202. data/examples/ramaze/layout/default.html.erb +8 -0
  203. data/examples/ramaze/view/index.html.erb +5 -0
  204. data/examples/ruby2python/features/fibonacci.feature +19 -0
  205. data/examples/ruby2python/features/step_definitions/fib_steps.rb +7 -0
  206. data/examples/ruby2python/features/support/env.rb +21 -0
  207. data/examples/ruby2python/lib/.gitignore +1 -0
  208. data/examples/ruby2python/lib/fib.py +7 -0
  209. data/examples/selenium/Rakefile +6 -0
  210. data/examples/selenium/features/search.feature +9 -0
  211. data/examples/selenium/features/step_definitons/search_steps.rb +13 -0
  212. data/examples/selenium/features/support/env.rb +19 -0
  213. data/examples/selenium_webrat/Rakefile +6 -0
  214. data/examples/selenium_webrat/config.ru +0 -0
  215. data/examples/selenium_webrat/features/search.feature +9 -0
  216. data/examples/selenium_webrat/features/step_definitons/search_steps.rb +13 -0
  217. data/examples/selenium_webrat/features/support/env.rb +45 -0
  218. data/examples/self_test/.gitignore +1 -0
  219. data/examples/self_test/README.textile +6 -0
  220. data/examples/self_test/Rakefile +6 -0
  221. data/examples/self_test/features/background/background_tagged_before_on_outline.feature +12 -0
  222. data/examples/self_test/features/background/background_with_name.feature +7 -0
  223. data/examples/self_test/features/background/failing_background.feature +12 -0
  224. data/examples/self_test/features/background/failing_background_after_success.feature +11 -0
  225. data/examples/self_test/features/background/multiline_args_background.feature +32 -0
  226. data/examples/self_test/features/background/passing_background.feature +10 -0
  227. data/examples/self_test/features/background/pending_background.feature +10 -0
  228. data/examples/self_test/features/background/scenario_outline_failing_background.feature +16 -0
  229. data/examples/self_test/features/background/scenario_outline_passing_background.feature +16 -0
  230. data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
  231. data/examples/self_test/features/failing_expectation.feature +4 -0
  232. data/examples/self_test/features/lots_of_undefined.feature +8 -0
  233. data/examples/self_test/features/multiline_name.feature +27 -0
  234. data/examples/self_test/features/outline_sample.feature +15 -0
  235. data/examples/self_test/features/sample.feature +21 -0
  236. data/examples/self_test/features/search_sample.feature +32 -0
  237. data/examples/self_test/features/step_definitions/sample_steps.rb +81 -0
  238. data/examples/self_test/features/support/env.rb +18 -0
  239. data/examples/self_test/features/tags_sample.feature +17 -0
  240. data/examples/self_test/features/tons_of_cukes.feature +52 -0
  241. data/examples/self_test/features/undefined_multiline_args.feature +12 -0
  242. data/examples/self_test/list-of-features.txt +1 -0
  243. data/examples/sinatra/README.textile +13 -0
  244. data/examples/sinatra/Rakefile +6 -0
  245. data/examples/sinatra/app.rb +14 -0
  246. data/examples/sinatra/features/add.feature +11 -0
  247. data/examples/sinatra/features/step_definitions/add_steps.rb +15 -0
  248. data/examples/sinatra/features/support/env.rb +30 -0
  249. data/examples/sinatra/views/add.erb +5 -0
  250. data/examples/sinatra/views/layout.erb +8 -0
  251. data/examples/steps_library/features/step_definitions/steps_lib1.rb +8 -0
  252. data/examples/steps_library/features/step_definitions/steps_lib2.rb +8 -0
  253. data/examples/tcl/README.textile +11 -0
  254. data/examples/tcl/Rakefile +6 -0
  255. data/examples/tcl/features/fibonnacci.feature +17 -0
  256. data/examples/tcl/features/step_definitions/fib_steps.rb +7 -0
  257. data/examples/tcl/features/support/env.rb +6 -0
  258. data/examples/tcl/src/fib.tcl +3 -0
  259. data/examples/test_unit/Rakefile +6 -0
  260. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +23 -0
  261. data/examples/test_unit/features/test_unit.feature +9 -0
  262. data/examples/tickets/Rakefile +20 -0
  263. data/examples/tickets/features.html +138 -0
  264. data/examples/tickets/features/172.feature +28 -0
  265. data/examples/tickets/features/177/1.feature +28 -0
  266. data/examples/tickets/features/177/2.feature +20 -0
  267. data/examples/tickets/features/177/3.feature +18 -0
  268. data/examples/tickets/features/180.feature +7 -0
  269. data/examples/tickets/features/229/tagged_hooks.feature +8 -0
  270. data/examples/tickets/features/229/tagged_hooks.rb +14 -0
  271. data/examples/tickets/features/236.feature +13 -0
  272. data/examples/tickets/features/241.feature +12 -0
  273. data/examples/tickets/features/246.feature +4 -0
  274. data/examples/tickets/features/248.feature +11 -0
  275. data/examples/tickets/features/270/back.feature +14 -0
  276. data/examples/tickets/features/270/back.steps.rb +14 -0
  277. data/examples/tickets/features/272/hooks.feature +26 -0
  278. data/examples/tickets/features/272/hooks_steps.rb +53 -0
  279. data/examples/tickets/features/279/py_string_indent.feature +25 -0
  280. data/examples/tickets/features/279/py_string_indent.steps.rb +12 -0
  281. data/examples/tickets/features/279/wrong.feature_ +11 -0
  282. data/examples/tickets/features/301/filter_background_tagged_hooks.feature +6 -0
  283. data/examples/tickets/features/301/filter_background_tagged_hooks_steps.rb +12 -0
  284. data/examples/tickets/features/306/only_background.feature +4 -0
  285. data/examples/tickets/features/lib/eatting_machine.rb +18 -0
  286. data/examples/tickets/features/lib/pantry.rb +20 -0
  287. data/examples/tickets/features/scenario_outline.feature +95 -0
  288. data/examples/tickets/features/step_definitons/246_steps.rb +3 -0
  289. data/examples/tickets/features/step_definitons/248_steps.rb +15 -0
  290. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +42 -0
  291. data/examples/tickets/features/step_definitons/tickets_steps.rb +81 -0
  292. data/examples/tickets/features/table_diffing.feature +13 -0
  293. data/examples/tickets/features/tickets.feature +28 -0
  294. data/examples/watir/README.textile +16 -0
  295. data/examples/watir/Rakefile +10 -0
  296. data/examples/watir/features/search.feature +12 -0
  297. data/examples/watir/features/step_definitions/search_steps.rb +26 -0
  298. data/examples/watir/features/support/env.rb +32 -0
  299. data/examples/watir/features/support/screenshots.rb +44 -0
  300. data/examples/webrat/features/search.feature +12 -0
  301. data/examples/webrat/features/step_definitions/kvasir_steps.rb +14 -0
  302. data/examples/webrat/features/support/env.rb +17 -0
  303. data/features/announce.feature +122 -0
  304. data/features/background.feature +308 -0
  305. data/features/bug_371.feature +32 -0
  306. data/features/bug_464.feature +16 -0
  307. data/features/bug_475.feature +43 -0
  308. data/features/call_many_steps.feature +124 -0
  309. data/features/cucumber_cli.feature +654 -0
  310. data/features/cucumber_cli_diff_disabled.feature +52 -0
  311. data/features/cucumber_cli_outlines.feature +105 -0
  312. data/features/custom_formatter.feature +47 -0
  313. data/features/default_snippets.feature +42 -0
  314. data/features/drb_server_integration.feature +174 -0
  315. data/features/exception_in_after_block.feature +100 -0
  316. data/features/exception_in_after_step_block.feature +102 -0
  317. data/features/exception_in_before_block.feature +78 -0
  318. data/features/exclude_files.feature +20 -0
  319. data/features/expand.feature +60 -0
  320. data/features/html_formatter.feature +7 -0
  321. data/features/html_formatter/a.html +400 -0
  322. data/features/junit_formatter.feature +88 -0
  323. data/features/language_from_header.feature +30 -0
  324. data/features/language_help.feature +68 -0
  325. data/features/listener_debugger_formatter.feature +41 -0
  326. data/features/multiline_names.feature +43 -0
  327. data/features/negative_tagged_hooks.feature +61 -0
  328. data/features/post_configuration_hook.feature +37 -0
  329. data/features/profiles.feature +112 -0
  330. data/features/rake_task.feature +152 -0
  331. data/features/report_called_undefined_steps.feature +34 -0
  332. data/features/simplest.feature +11 -0
  333. data/features/snippet.feature +22 -0
  334. data/features/step_definitions/cucumber_steps.rb +154 -0
  335. data/features/step_definitions/extra_steps.rb +2 -0
  336. data/features/step_definitions/simplest_steps.rb +3 -0
  337. data/features/step_definitions/wire_steps.rb +14 -0
  338. data/features/support/env.rb +141 -0
  339. data/features/support/env.rb.simplest +7 -0
  340. data/features/support/fake_wire_server.rb +63 -0
  341. data/features/table_diffing.feature +45 -0
  342. data/features/table_mapping.feature +35 -0
  343. data/features/tag_logic.feature +258 -0
  344. data/features/transform.feature +245 -0
  345. data/features/unicode_table.feature +35 -0
  346. data/features/usage_and_stepdefs_formatter.feature +169 -0
  347. data/features/wire_protocol.feature +177 -0
  348. data/features/work_in_progress.feature +156 -0
  349. data/gem_tasks/contributors.rake +13 -0
  350. data/gem_tasks/environment.rake +7 -0
  351. data/gem_tasks/features.rake +18 -0
  352. data/gem_tasks/fix_cr_lf.rake +10 -0
  353. data/gem_tasks/flog.rake +4 -0
  354. data/gem_tasks/rspec.rake +15 -0
  355. data/gem_tasks/sass.rake +4 -0
  356. data/gem_tasks/sdoc.rake +12 -0
  357. data/lib/README.rdoc +12 -0
  358. data/lib/autotest/cucumber.rb +6 -0
  359. data/lib/autotest/cucumber_mixin.rb +131 -0
  360. data/lib/autotest/cucumber_rails.rb +6 -0
  361. data/lib/autotest/cucumber_rails_rspec.rb +6 -0
  362. data/lib/autotest/cucumber_rspec.rb +6 -0
  363. data/lib/autotest/discover.rb +9 -0
  364. data/lib/cucumber.rb +15 -0
  365. data/lib/cucumber/ast.rb +30 -0
  366. data/lib/cucumber/ast/background.rb +75 -0
  367. data/lib/cucumber/ast/comment.rb +31 -0
  368. data/lib/cucumber/ast/examples.rb +36 -0
  369. data/lib/cucumber/ast/feature.rb +85 -0
  370. data/lib/cucumber/ast/feature_element.rb +68 -0
  371. data/lib/cucumber/ast/features.rb +40 -0
  372. data/lib/cucumber/ast/outline_table.rb +166 -0
  373. data/lib/cucumber/ast/py_string.rb +59 -0
  374. data/lib/cucumber/ast/scenario.rb +111 -0
  375. data/lib/cucumber/ast/scenario_outline.rb +100 -0
  376. data/lib/cucumber/ast/step.rb +121 -0
  377. data/lib/cucumber/ast/step_collection.rb +76 -0
  378. data/lib/cucumber/ast/step_invocation.rb +190 -0
  379. data/lib/cucumber/ast/table.rb +655 -0
  380. data/lib/cucumber/ast/tags.rb +122 -0
  381. data/lib/cucumber/ast/tree_walker.rb +201 -0
  382. data/lib/cucumber/ast/visitor.rb +11 -0
  383. data/lib/cucumber/broadcaster.rb +13 -0
  384. data/lib/cucumber/cli/configuration.rb +180 -0
  385. data/lib/cucumber/cli/drb_client.rb +32 -0
  386. data/lib/cucumber/cli/language_help_formatter.rb +72 -0
  387. data/lib/cucumber/cli/main.rb +121 -0
  388. data/lib/cucumber/cli/options.rb +404 -0
  389. data/lib/cucumber/cli/profile_loader.rb +82 -0
  390. data/lib/cucumber/constantize.rb +34 -0
  391. data/lib/cucumber/core_ext/instance_exec.rb +98 -0
  392. data/lib/cucumber/core_ext/proc.rb +30 -0
  393. data/lib/cucumber/core_ext/string.rb +16 -0
  394. data/lib/cucumber/feature_file.rb +54 -0
  395. data/lib/cucumber/filter.rb +41 -0
  396. data/lib/cucumber/formatter/ansicolor.rb +157 -0
  397. data/lib/cucumber/formatter/color_io.rb +23 -0
  398. data/lib/cucumber/formatter/console.rb +205 -0
  399. data/lib/cucumber/formatter/cucumber.css +248 -0
  400. data/lib/cucumber/formatter/cucumber.sass +241 -0
  401. data/lib/cucumber/formatter/debug.rb +33 -0
  402. data/lib/cucumber/formatter/duration.rb +13 -0
  403. data/lib/cucumber/formatter/html.rb +545 -0
  404. data/lib/cucumber/formatter/io.rb +33 -0
  405. data/lib/cucumber/formatter/junit.rb +149 -0
  406. data/lib/cucumber/formatter/ordered_xml_markup.rb +24 -0
  407. data/lib/cucumber/formatter/pdf.rb +234 -0
  408. data/lib/cucumber/formatter/pretty.rb +237 -0
  409. data/lib/cucumber/formatter/progress.rb +75 -0
  410. data/lib/cucumber/formatter/rerun.rb +50 -0
  411. data/lib/cucumber/formatter/stepdefs.rb +14 -0
  412. data/lib/cucumber/formatter/steps.rb +49 -0
  413. data/lib/cucumber/formatter/summary.rb +35 -0
  414. data/lib/cucumber/formatter/tag_cloud.rb +34 -0
  415. data/lib/cucumber/formatter/unicode.rb +35 -0
  416. data/lib/cucumber/formatter/usage.rb +127 -0
  417. data/lib/cucumber/language_support.rb +30 -0
  418. data/lib/cucumber/language_support/language_methods.rb +110 -0
  419. data/lib/cucumber/languages.yml +535 -0
  420. data/lib/cucumber/parser.rb +8 -0
  421. data/lib/cucumber/parser/common.rb +170 -0
  422. data/lib/cucumber/parser/common.tt +21 -0
  423. data/lib/cucumber/parser/feature.rb +1783 -0
  424. data/lib/cucumber/parser/feature.tt +317 -0
  425. data/lib/cucumber/parser/i18n.tt +34 -0
  426. data/lib/cucumber/parser/natural_language.rb +108 -0
  427. data/lib/cucumber/parser/py_string.rb +276 -0
  428. data/lib/cucumber/parser/py_string.tt +45 -0
  429. data/lib/cucumber/parser/table.rb +305 -0
  430. data/lib/cucumber/parser/table.tt +60 -0
  431. data/lib/cucumber/parser/treetop_ext.rb +53 -0
  432. data/lib/cucumber/platform.rb +31 -0
  433. data/lib/cucumber/py_support/py_dsl.py +10 -0
  434. data/lib/cucumber/py_support/py_language.py +10 -0
  435. data/lib/cucumber/py_support/py_language.rb +81 -0
  436. data/lib/cucumber/rake/task.rb +166 -0
  437. data/lib/cucumber/rb_support/rb_dsl.rb +102 -0
  438. data/lib/cucumber/rb_support/rb_hook.rb +19 -0
  439. data/lib/cucumber/rb_support/rb_language.rb +179 -0
  440. data/lib/cucumber/rb_support/rb_step_definition.rb +75 -0
  441. data/lib/cucumber/rb_support/rb_transform.rb +37 -0
  442. data/lib/cucumber/rb_support/rb_world.rb +81 -0
  443. data/lib/cucumber/rb_support/regexp_argument_matcher.rb +21 -0
  444. data/lib/cucumber/rspec_neuter.rb +23 -0
  445. data/lib/cucumber/step_argument.rb +9 -0
  446. data/lib/cucumber/step_definition_light.rb +20 -0
  447. data/lib/cucumber/step_match.rb +107 -0
  448. data/lib/cucumber/step_mother.rb +350 -0
  449. data/lib/cucumber/webrat/element_locator.rb +93 -0
  450. data/lib/cucumber/webrat/table_locator.rb +1 -0
  451. data/lib/cucumber/wire_support/connection.rb +42 -0
  452. data/lib/cucumber/wire_support/request_handler.rb +19 -0
  453. data/lib/cucumber/wire_support/wire_exception.rb +10 -0
  454. data/lib/cucumber/wire_support/wire_language.rb +52 -0
  455. data/lib/cucumber/wire_support/wire_packet.rb +34 -0
  456. data/lib/cucumber/wire_support/wire_protocol.rb +64 -0
  457. data/lib/cucumber/wire_support/wire_step_definition.rb +21 -0
  458. data/spec/cucumber/ast/background_spec.rb +54 -0
  459. data/spec/cucumber/ast/feature_element_spec.rb +41 -0
  460. data/spec/cucumber/ast/feature_factory.rb +62 -0
  461. data/spec/cucumber/ast/feature_spec.rb +44 -0
  462. data/spec/cucumber/ast/outline_table_spec.rb +21 -0
  463. data/spec/cucumber/ast/py_string_spec.rb +51 -0
  464. data/spec/cucumber/ast/scenario_outline_spec.rb +73 -0
  465. data/spec/cucumber/ast/scenario_spec.rb +45 -0
  466. data/spec/cucumber/ast/step_collection_spec.rb +17 -0
  467. data/spec/cucumber/ast/step_spec.rb +66 -0
  468. data/spec/cucumber/ast/table_spec.rb +422 -0
  469. data/spec/cucumber/ast/tags_spec.rb +29 -0
  470. data/spec/cucumber/ast/tree_walker_spec.rb +11 -0
  471. data/spec/cucumber/broadcaster_spec.rb +15 -0
  472. data/spec/cucumber/cli/configuration_spec.rb +396 -0
  473. data/spec/cucumber/cli/drb_client_spec.rb +77 -0
  474. data/spec/cucumber/cli/main_spec.rb +172 -0
  475. data/spec/cucumber/cli/options_spec.rb +335 -0
  476. data/spec/cucumber/cli/profile_loader_spec.rb +10 -0
  477. data/spec/cucumber/core_ext/proc_spec.rb +68 -0
  478. data/spec/cucumber/formatter/ansicolor_spec.rb +31 -0
  479. data/spec/cucumber/formatter/color_io_spec.rb +27 -0
  480. data/spec/cucumber/formatter/console_spec.rb +20 -0
  481. data/spec/cucumber/formatter/duration_spec.rb +22 -0
  482. data/spec/cucumber/formatter/html_spec.rb +213 -0
  483. data/spec/cucumber/formatter/junit_spec.rb +110 -0
  484. data/spec/cucumber/formatter/progress_spec.rb +38 -0
  485. data/spec/cucumber/formatter/spec_helper.rb +50 -0
  486. data/spec/cucumber/parser/feature_parser_spec.rb +400 -0
  487. data/spec/cucumber/parser/table_parser_spec.rb +52 -0
  488. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +132 -0
  489. data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +18 -0
  490. data/spec/cucumber/sell_cucumbers.feature +19 -0
  491. data/spec/cucumber/step_match_spec.rb +56 -0
  492. data/spec/cucumber/step_mother_spec.rb +270 -0
  493. data/spec/cucumber/treetop_parser/empty_feature.feature +4 -0
  494. data/spec/cucumber/treetop_parser/empty_scenario.feature +9 -0
  495. data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
  496. data/spec/cucumber/treetop_parser/fit_scenario.feature +8 -0
  497. data/spec/cucumber/treetop_parser/given_scenario.feature +9 -0
  498. data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
  499. data/spec/cucumber/treetop_parser/multiline_steps.feature +17 -0
  500. data/spec/cucumber/treetop_parser/multiple_tables.feature +27 -0
  501. data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
  502. data/spec/cucumber/treetop_parser/spaces.feature +12 -0
  503. data/spec/cucumber/treetop_parser/test_dos.feature +25 -0
  504. data/spec/cucumber/treetop_parser/with_comments.feature +23 -0
  505. data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
  506. data/spec/cucumber/wire_support/wire_language_spec.rb +47 -0
  507. data/spec/cucumber/wire_support/wire_packet_spec.rb +26 -0
  508. data/spec/cucumber/world/pending_spec.rb +46 -0
  509. data/spec/spec.opts +4 -0
  510. data/spec/spec_helper.rb +18 -0
  511. metadata +813 -0
@@ -0,0 +1,8 @@
1
+ require 'erb'
2
+ require 'cucumber/platform'
3
+ require 'cucumber/ast'
4
+ require 'cucumber/parser/treetop_ext'
5
+ require 'cucumber/parser/common'
6
+ require 'cucumber/parser/table'
7
+ require 'cucumber/parser/py_string'
8
+ require 'cucumber/parser/feature'
@@ -0,0 +1,170 @@
1
+ # Autogenerated from a Treetop grammar. Edits may be lost.
2
+
3
+
4
+ module Cucumber
5
+ module Parser
6
+ module Common
7
+ include Treetop::Runtime
8
+
9
+ def root
10
+ @root || :white
11
+ end
12
+
13
+ def _nt_white
14
+ start_index = index
15
+ if node_cache[:white].has_key?(index)
16
+ cached = node_cache[:white][index]
17
+ @index = cached.interval.end if cached
18
+ return cached
19
+ end
20
+
21
+ s0, i0 = [], index
22
+ loop do
23
+ i1 = index
24
+ r2 = _nt_space
25
+ if r2
26
+ r1 = r2
27
+ else
28
+ r3 = _nt_eol
29
+ if r3
30
+ r1 = r3
31
+ else
32
+ @index = i1
33
+ r1 = nil
34
+ end
35
+ end
36
+ if r1
37
+ s0 << r1
38
+ else
39
+ break
40
+ end
41
+ end
42
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
43
+
44
+ node_cache[:white][start_index] = r0
45
+
46
+ r0
47
+ end
48
+
49
+ def _nt_space
50
+ start_index = index
51
+ if node_cache[:space].has_key?(index)
52
+ cached = node_cache[:space][index]
53
+ @index = cached.interval.end if cached
54
+ return cached
55
+ end
56
+
57
+ if has_terminal?('\G[ \\t]', true, index)
58
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
59
+ @index += 1
60
+ else
61
+ r0 = nil
62
+ end
63
+
64
+ node_cache[:space][start_index] = r0
65
+
66
+ r0
67
+ end
68
+
69
+ module Eol0
70
+ end
71
+
72
+ def _nt_eol
73
+ start_index = index
74
+ if node_cache[:eol].has_key?(index)
75
+ cached = node_cache[:eol][index]
76
+ @index = cached.interval.end if cached
77
+ return cached
78
+ end
79
+
80
+ i0 = index
81
+ if has_terminal?("\n", false, index)
82
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
83
+ @index += 1
84
+ else
85
+ terminal_parse_failure("\n")
86
+ r1 = nil
87
+ end
88
+ if r1
89
+ r0 = r1
90
+ else
91
+ i2, s2 = index, []
92
+ if has_terminal?("\r", false, index)
93
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
94
+ @index += 1
95
+ else
96
+ terminal_parse_failure("\r")
97
+ r3 = nil
98
+ end
99
+ s2 << r3
100
+ if r3
101
+ if has_terminal?("\n", false, index)
102
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
103
+ @index += 1
104
+ else
105
+ terminal_parse_failure("\n")
106
+ r5 = nil
107
+ end
108
+ if r5
109
+ r4 = r5
110
+ else
111
+ r4 = instantiate_node(SyntaxNode,input, index...index)
112
+ end
113
+ s2 << r4
114
+ end
115
+ if s2.last
116
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
117
+ r2.extend(Eol0)
118
+ else
119
+ @index = i2
120
+ r2 = nil
121
+ end
122
+ if r2
123
+ r0 = r2
124
+ else
125
+ @index = i0
126
+ r0 = nil
127
+ end
128
+ end
129
+
130
+ node_cache[:eol][start_index] = r0
131
+
132
+ r0
133
+ end
134
+
135
+ def _nt_eof
136
+ start_index = index
137
+ if node_cache[:eof].has_key?(index)
138
+ cached = node_cache[:eof][index]
139
+ @index = cached.interval.end if cached
140
+ return cached
141
+ end
142
+
143
+ i0 = index
144
+ if index < input_length
145
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
146
+ @index += 1
147
+ else
148
+ terminal_parse_failure("any character")
149
+ r1 = nil
150
+ end
151
+ if r1
152
+ r0 = nil
153
+ else
154
+ @index = i0
155
+ r0 = instantiate_node(SyntaxNode,input, index...index)
156
+ end
157
+
158
+ node_cache[:eof][start_index] = r0
159
+
160
+ r0
161
+ end
162
+
163
+ end
164
+
165
+ class CommonParser < Treetop::Runtime::CompiledParser
166
+ include Common
167
+ end
168
+
169
+ end
170
+ end
@@ -0,0 +1,21 @@
1
+ module Cucumber
2
+ module Parser
3
+ grammar Common
4
+ rule white
5
+ (space / eol)*
6
+ end
7
+
8
+ rule space
9
+ [ \t]
10
+ end
11
+
12
+ rule eol
13
+ "\n" / ("\r" "\n"?)
14
+ end
15
+
16
+ rule eof
17
+ !.
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,1783 @@
1
+ # Autogenerated from a Treetop grammar. Edits may be lost.
2
+
3
+
4
+ module Cucumber
5
+ module Parser
6
+ # TIP: When you hack on the grammar, just delete feature.rb in this directory.
7
+ # Also make sure you have uninstalled all cucumber gems (don't forget xxx-cucumber
8
+ # github gems).
9
+ #
10
+ # Treetop will then generate the parser in-memory. When you're happy, just generate
11
+ # the rb file with tt feature.tt
12
+ module Feature
13
+ include Treetop::Runtime
14
+
15
+ def root
16
+ @root || :feature_sub
17
+ end
18
+
19
+ module FeatureSub0
20
+ end
21
+
22
+ module FeatureSub1
23
+ def white1
24
+ elements[0]
25
+ end
26
+
27
+ def comment
28
+ elements[1]
29
+ end
30
+
31
+ def white2
32
+ elements[2]
33
+ end
34
+
35
+ def tags
36
+ elements[3]
37
+ end
38
+
39
+ def white3
40
+ elements[4]
41
+ end
42
+
43
+ def header
44
+ elements[5]
45
+ end
46
+
47
+ def bg
48
+ elements[6]
49
+ end
50
+
51
+ def feature_elements
52
+ elements[7]
53
+ end
54
+
55
+ end
56
+
57
+ module FeatureSub2
58
+ def build(filter)
59
+ if(filter.nil? || feature_elements.accept?(filter) || (!bg.empty? && filter.accept?(bg)))
60
+ background = bg.respond_to?(:build) ? bg.build : nil
61
+ Ast::Feature.new(
62
+ background,
63
+ comment.build,
64
+ tags.build,
65
+ header.text_value,
66
+ feature_elements.build(background, filter)
67
+ )
68
+ end
69
+ end
70
+ end
71
+
72
+ def _nt_feature_sub
73
+ start_index = index
74
+ if node_cache[:feature_sub].has_key?(index)
75
+ cached = node_cache[:feature_sub][index]
76
+ @index = cached.interval.end if cached
77
+ return cached
78
+ end
79
+
80
+ i0, s0 = index, []
81
+ r1 = _nt_white
82
+ s0 << r1
83
+ if r1
84
+ r2 = _nt_comment
85
+ s0 << r2
86
+ if r2
87
+ r3 = _nt_white
88
+ s0 << r3
89
+ if r3
90
+ r4 = _nt_tags
91
+ s0 << r4
92
+ if r4
93
+ r5 = _nt_white
94
+ s0 << r5
95
+ if r5
96
+ s6, i6 = [], index
97
+ loop do
98
+ i7, s7 = index, []
99
+ i8 = index
100
+ i9 = index
101
+ r10 = _nt_scenario_outline
102
+ if r10
103
+ r9 = r10
104
+ else
105
+ r11 = _nt_scenario
106
+ if r11
107
+ r9 = r11
108
+ else
109
+ r12 = _nt_background
110
+ if r12
111
+ r9 = r12
112
+ else
113
+ @index = i9
114
+ r9 = nil
115
+ end
116
+ end
117
+ end
118
+ if r9
119
+ r8 = nil
120
+ else
121
+ @index = i8
122
+ r8 = instantiate_node(SyntaxNode,input, index...index)
123
+ end
124
+ s7 << r8
125
+ if r8
126
+ if index < input_length
127
+ r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
128
+ @index += 1
129
+ else
130
+ terminal_parse_failure("any character")
131
+ r13 = nil
132
+ end
133
+ s7 << r13
134
+ end
135
+ if s7.last
136
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
137
+ r7.extend(FeatureSub0)
138
+ else
139
+ @index = i7
140
+ r7 = nil
141
+ end
142
+ if r7
143
+ s6 << r7
144
+ else
145
+ break
146
+ end
147
+ end
148
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
149
+ s0 << r6
150
+ if r6
151
+ r15 = _nt_background
152
+ if r15
153
+ r14 = r15
154
+ else
155
+ r14 = instantiate_node(SyntaxNode,input, index...index)
156
+ end
157
+ s0 << r14
158
+ if r14
159
+ r16 = _nt_feature_elements
160
+ s0 << r16
161
+ if r16
162
+ r18 = _nt_comment
163
+ if r18
164
+ r17 = r18
165
+ else
166
+ r17 = instantiate_node(SyntaxNode,input, index...index)
167
+ end
168
+ s0 << r17
169
+ end
170
+ end
171
+ end
172
+ end
173
+ end
174
+ end
175
+ end
176
+ end
177
+ if s0.last
178
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
179
+ r0.extend(FeatureSub1)
180
+ r0.extend(FeatureSub2)
181
+ else
182
+ @index = i0
183
+ r0 = nil
184
+ end
185
+
186
+ node_cache[:feature_sub][start_index] = r0
187
+
188
+ r0
189
+ end
190
+
191
+ module Tags0
192
+ def tag
193
+ elements[0]
194
+ end
195
+
196
+ end
197
+
198
+ module Tags1
199
+ def white
200
+ elements[0]
201
+ end
202
+
203
+ def ts
204
+ elements[1]
205
+ end
206
+ end
207
+
208
+ module Tags2
209
+ def at_line?(line)
210
+ ts.elements.detect{|e| e.tag.line == line}
211
+ end
212
+
213
+ def build
214
+ Ast::Tags.new(ts.line, tag_names)
215
+ end
216
+
217
+ def tag_names
218
+ @tag_names ||= ts.elements.map{|e| e.tag.text_value}
219
+ end
220
+ end
221
+
222
+ def _nt_tags
223
+ start_index = index
224
+ if node_cache[:tags].has_key?(index)
225
+ cached = node_cache[:tags][index]
226
+ @index = cached.interval.end if cached
227
+ return cached
228
+ end
229
+
230
+ i0, s0 = index, []
231
+ r1 = _nt_white
232
+ s0 << r1
233
+ if r1
234
+ s2, i2 = [], index
235
+ loop do
236
+ i3, s3 = index, []
237
+ r4 = _nt_tag
238
+ s3 << r4
239
+ if r4
240
+ s5, i5 = [], index
241
+ loop do
242
+ i6 = index
243
+ r7 = _nt_space
244
+ if r7
245
+ r6 = r7
246
+ else
247
+ r8 = _nt_eol
248
+ if r8
249
+ r6 = r8
250
+ else
251
+ @index = i6
252
+ r6 = nil
253
+ end
254
+ end
255
+ if r6
256
+ s5 << r6
257
+ else
258
+ break
259
+ end
260
+ end
261
+ if s5.empty?
262
+ @index = i5
263
+ r5 = nil
264
+ else
265
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
266
+ end
267
+ s3 << r5
268
+ end
269
+ if s3.last
270
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
271
+ r3.extend(Tags0)
272
+ else
273
+ @index = i3
274
+ r3 = nil
275
+ end
276
+ if r3
277
+ s2 << r3
278
+ else
279
+ break
280
+ end
281
+ end
282
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
283
+ s0 << r2
284
+ end
285
+ if s0.last
286
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
287
+ r0.extend(Tags1)
288
+ r0.extend(Tags2)
289
+ else
290
+ @index = i0
291
+ r0 = nil
292
+ end
293
+
294
+ node_cache[:tags][start_index] = r0
295
+
296
+ r0
297
+ end
298
+
299
+ module Tag0
300
+ end
301
+
302
+ def _nt_tag
303
+ start_index = index
304
+ if node_cache[:tag].has_key?(index)
305
+ cached = node_cache[:tag][index]
306
+ @index = cached.interval.end if cached
307
+ return cached
308
+ end
309
+
310
+ i0, s0 = index, []
311
+ if has_terminal?('@', false, index)
312
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
313
+ @index += 1
314
+ else
315
+ terminal_parse_failure('@')
316
+ r1 = nil
317
+ end
318
+ s0 << r1
319
+ if r1
320
+ s2, i2 = [], index
321
+ loop do
322
+ if has_terminal?('\G[^@\\r\\n\\t ]', true, index)
323
+ r3 = true
324
+ @index += 1
325
+ else
326
+ r3 = nil
327
+ end
328
+ if r3
329
+ s2 << r3
330
+ else
331
+ break
332
+ end
333
+ end
334
+ if s2.empty?
335
+ @index = i2
336
+ r2 = nil
337
+ else
338
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
339
+ end
340
+ s0 << r2
341
+ end
342
+ if s0.last
343
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
344
+ r0.extend(Tag0)
345
+ else
346
+ @index = i0
347
+ r0 = nil
348
+ end
349
+
350
+ node_cache[:tag][start_index] = r0
351
+
352
+ r0
353
+ end
354
+
355
+ module Comment0
356
+ def comment_line
357
+ elements[0]
358
+ end
359
+
360
+ def white
361
+ elements[1]
362
+ end
363
+ end
364
+
365
+ module Comment1
366
+ def build
367
+ Ast::Comment.new(text_value)
368
+ end
369
+ end
370
+
371
+ def _nt_comment
372
+ start_index = index
373
+ if node_cache[:comment].has_key?(index)
374
+ cached = node_cache[:comment][index]
375
+ @index = cached.interval.end if cached
376
+ return cached
377
+ end
378
+
379
+ s0, i0 = [], index
380
+ loop do
381
+ i1, s1 = index, []
382
+ r2 = _nt_comment_line
383
+ s1 << r2
384
+ if r2
385
+ r3 = _nt_white
386
+ s1 << r3
387
+ end
388
+ if s1.last
389
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
390
+ r1.extend(Comment0)
391
+ else
392
+ @index = i1
393
+ r1 = nil
394
+ end
395
+ if r1
396
+ s0 << r1
397
+ else
398
+ break
399
+ end
400
+ end
401
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
402
+ r0.extend(Comment1)
403
+
404
+ node_cache[:comment][start_index] = r0
405
+
406
+ r0
407
+ end
408
+
409
+ module CommentLine0
410
+ def line_to_eol
411
+ elements[2]
412
+ end
413
+ end
414
+
415
+ def _nt_comment_line
416
+ start_index = index
417
+ if node_cache[:comment_line].has_key?(index)
418
+ cached = node_cache[:comment_line][index]
419
+ @index = cached.interval.end if cached
420
+ return cached
421
+ end
422
+
423
+ i0, s0 = index, []
424
+ s1, i1 = [], index
425
+ loop do
426
+ r2 = _nt_space
427
+ if r2
428
+ s1 << r2
429
+ else
430
+ break
431
+ end
432
+ end
433
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
434
+ s0 << r1
435
+ if r1
436
+ if has_terminal?('#', false, index)
437
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
438
+ @index += 1
439
+ else
440
+ terminal_parse_failure('#')
441
+ r3 = nil
442
+ end
443
+ s0 << r3
444
+ if r3
445
+ r4 = _nt_line_to_eol
446
+ s0 << r4
447
+ end
448
+ end
449
+ if s0.last
450
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
451
+ r0.extend(CommentLine0)
452
+ else
453
+ @index = i0
454
+ r0 = nil
455
+ end
456
+
457
+ node_cache[:comment_line][start_index] = r0
458
+
459
+ r0
460
+ end
461
+
462
+ module Background0
463
+ def comment
464
+ elements[0]
465
+ end
466
+
467
+ def white
468
+ elements[1]
469
+ end
470
+
471
+ def background_keyword
472
+ elements[2]
473
+ end
474
+
475
+ def name
476
+ elements[4]
477
+ end
478
+
479
+ def steps
480
+ elements[6]
481
+ end
482
+ end
483
+
484
+ module Background1
485
+ def matches_name?(regexp_to_match)
486
+ name.build =~ regexp_to_match
487
+ end
488
+
489
+ def at_line?(line)
490
+ background_keyword.line == line ||
491
+ steps.at_line?(line)
492
+ end
493
+
494
+ def matches_tags?(tag_names)
495
+ Ast::Tags.matches?(self.parent.tags.tag_names, tag_names)
496
+ end
497
+
498
+ def build
499
+ Ast::Background.new(
500
+ comment.build,
501
+ background_keyword.line,
502
+ background_keyword.text_value,
503
+ name.build,
504
+ steps.build
505
+ )
506
+ end
507
+ end
508
+
509
+ def _nt_background
510
+ start_index = index
511
+ if node_cache[:background].has_key?(index)
512
+ cached = node_cache[:background][index]
513
+ @index = cached.interval.end if cached
514
+ return cached
515
+ end
516
+
517
+ i0, s0 = index, []
518
+ r1 = _nt_comment
519
+ s0 << r1
520
+ if r1
521
+ r2 = _nt_white
522
+ s0 << r2
523
+ if r2
524
+ r3 = _nt_background_keyword
525
+ s0 << r3
526
+ if r3
527
+ s4, i4 = [], index
528
+ loop do
529
+ r5 = _nt_space
530
+ if r5
531
+ s4 << r5
532
+ else
533
+ break
534
+ end
535
+ end
536
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
537
+ s0 << r4
538
+ if r4
539
+ r7 = _nt_lines_to_keyword
540
+ if r7
541
+ r6 = r7
542
+ else
543
+ r6 = instantiate_node(SyntaxNode,input, index...index)
544
+ end
545
+ s0 << r6
546
+ if r6
547
+ i8 = index
548
+ s9, i9 = [], index
549
+ loop do
550
+ r10 = _nt_eol
551
+ if r10
552
+ s9 << r10
553
+ else
554
+ break
555
+ end
556
+ end
557
+ if s9.empty?
558
+ @index = i9
559
+ r9 = nil
560
+ else
561
+ r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
562
+ end
563
+ if r9
564
+ r8 = r9
565
+ else
566
+ r11 = _nt_eof
567
+ if r11
568
+ r8 = r11
569
+ else
570
+ @index = i8
571
+ r8 = nil
572
+ end
573
+ end
574
+ s0 << r8
575
+ if r8
576
+ r12 = _nt_steps
577
+ s0 << r12
578
+ end
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ if s0.last
585
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
586
+ r0.extend(Background0)
587
+ r0.extend(Background1)
588
+ else
589
+ @index = i0
590
+ r0 = nil
591
+ end
592
+
593
+ node_cache[:background][start_index] = r0
594
+
595
+ r0
596
+ end
597
+
598
+ module FeatureElements0
599
+ def accept?(filter)
600
+ filter.nil? || elements.empty? || elements.detect{|feature_element| filter.accept?(feature_element)}
601
+ end
602
+
603
+ def build(background, filter)
604
+ elements.map do |feature_element|
605
+ if filter.nil? || filter.accept?(feature_element)
606
+ feature_element.build(background, filter)
607
+ end
608
+ end.compact
609
+ end
610
+ end
611
+
612
+ def _nt_feature_elements
613
+ start_index = index
614
+ if node_cache[:feature_elements].has_key?(index)
615
+ cached = node_cache[:feature_elements][index]
616
+ @index = cached.interval.end if cached
617
+ return cached
618
+ end
619
+
620
+ s0, i0 = [], index
621
+ loop do
622
+ i1 = index
623
+ r2 = _nt_scenario
624
+ if r2
625
+ r1 = r2
626
+ else
627
+ r3 = _nt_scenario_outline
628
+ if r3
629
+ r1 = r3
630
+ else
631
+ @index = i1
632
+ r1 = nil
633
+ end
634
+ end
635
+ if r1
636
+ s0 << r1
637
+ else
638
+ break
639
+ end
640
+ end
641
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
642
+ r0.extend(FeatureElements0)
643
+
644
+ node_cache[:feature_elements][start_index] = r0
645
+
646
+ r0
647
+ end
648
+
649
+ module Scenario0
650
+ def comment
651
+ elements[0]
652
+ end
653
+
654
+ def tags
655
+ elements[1]
656
+ end
657
+
658
+ def white1
659
+ elements[2]
660
+ end
661
+
662
+ def scenario_keyword
663
+ elements[3]
664
+ end
665
+
666
+ def name
667
+ elements[5]
668
+ end
669
+
670
+ def white2
671
+ elements[6]
672
+ end
673
+
674
+ def steps
675
+ elements[7]
676
+ end
677
+
678
+ def white3
679
+ elements[8]
680
+ end
681
+ end
682
+
683
+ module Scenario1
684
+ def at_line?(line)
685
+ scenario_keyword.line == line ||
686
+ steps.at_line?(line) ||
687
+ tags.at_line?(line)
688
+ end
689
+
690
+ def matches_tags?(tag_names)
691
+ feature_tag_names = self.parent.parent.tags.tag_names
692
+ source_tag_names = (feature_tag_names + tags.tag_names).uniq
693
+ Ast::Tags.matches?(source_tag_names, tag_names)
694
+ end
695
+
696
+ def matches_name?(regexp_to_match)
697
+ name.build =~ regexp_to_match
698
+ end
699
+
700
+ def build(background, filter)
701
+ Ast::Scenario.new(
702
+ background,
703
+ comment.build,
704
+ tags.build,
705
+ scenario_keyword.line,
706
+ scenario_keyword.text_value,
707
+ name.build,
708
+ steps.build
709
+ )
710
+ end
711
+ end
712
+
713
+ def _nt_scenario
714
+ start_index = index
715
+ if node_cache[:scenario].has_key?(index)
716
+ cached = node_cache[:scenario][index]
717
+ @index = cached.interval.end if cached
718
+ return cached
719
+ end
720
+
721
+ i0, s0 = index, []
722
+ r1 = _nt_comment
723
+ s0 << r1
724
+ if r1
725
+ r2 = _nt_tags
726
+ s0 << r2
727
+ if r2
728
+ r3 = _nt_white
729
+ s0 << r3
730
+ if r3
731
+ r4 = _nt_scenario_keyword
732
+ s0 << r4
733
+ if r4
734
+ s5, i5 = [], index
735
+ loop do
736
+ r6 = _nt_space
737
+ if r6
738
+ s5 << r6
739
+ else
740
+ break
741
+ end
742
+ end
743
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
744
+ s0 << r5
745
+ if r5
746
+ r7 = _nt_lines_to_keyword
747
+ s0 << r7
748
+ if r7
749
+ r8 = _nt_white
750
+ s0 << r8
751
+ if r8
752
+ r9 = _nt_steps
753
+ s0 << r9
754
+ if r9
755
+ r10 = _nt_white
756
+ s0 << r10
757
+ end
758
+ end
759
+ end
760
+ end
761
+ end
762
+ end
763
+ end
764
+ end
765
+ if s0.last
766
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
767
+ r0.extend(Scenario0)
768
+ r0.extend(Scenario1)
769
+ else
770
+ @index = i0
771
+ r0 = nil
772
+ end
773
+
774
+ node_cache[:scenario][start_index] = r0
775
+
776
+ r0
777
+ end
778
+
779
+ module ScenarioOutline0
780
+ def comment
781
+ elements[0]
782
+ end
783
+
784
+ def tags
785
+ elements[1]
786
+ end
787
+
788
+ def white1
789
+ elements[2]
790
+ end
791
+
792
+ def scenario_outline_keyword
793
+ elements[3]
794
+ end
795
+
796
+ def name
797
+ elements[5]
798
+ end
799
+
800
+ def white2
801
+ elements[6]
802
+ end
803
+
804
+ def steps
805
+ elements[7]
806
+ end
807
+
808
+ def examples_sections
809
+ elements[8]
810
+ end
811
+
812
+ def white3
813
+ elements[9]
814
+ end
815
+ end
816
+
817
+ module ScenarioOutline1
818
+ def at_line?(line)
819
+ outline_at_line?(line) ||
820
+ examples_sections.at_line?(line) ||
821
+ tags.at_line?(line)
822
+ end
823
+
824
+ def outline_at_line?(line)
825
+ scenario_outline_keyword.line == line ||
826
+ steps.at_line?(line)
827
+ end
828
+
829
+ def matches_tags?(tag_names)
830
+ feature_tag_names = self.parent.parent.tags.tag_names
831
+ source_tag_names = (feature_tag_names + tags.tag_names).uniq
832
+ Ast::Tags.matches?(source_tag_names, tag_names)
833
+ end
834
+
835
+ def matches_name?(regexp_to_match)
836
+ outline_matches_name?(regexp_to_match) || examples_sections.matches_name?(regexp_to_match)
837
+ end
838
+
839
+ def outline_matches_name?(regexp_to_match)
840
+ name.build =~ regexp_to_match
841
+ end
842
+
843
+ def build(background, filter)
844
+ Ast::ScenarioOutline.new(
845
+ background,
846
+ comment.build,
847
+ tags.build,
848
+ scenario_outline_keyword.line,
849
+ scenario_outline_keyword.text_value,
850
+ name.build,
851
+ steps.build,
852
+ examples_sections.build(filter, self)
853
+ )
854
+ end
855
+ end
856
+
857
+ def _nt_scenario_outline
858
+ start_index = index
859
+ if node_cache[:scenario_outline].has_key?(index)
860
+ cached = node_cache[:scenario_outline][index]
861
+ @index = cached.interval.end if cached
862
+ return cached
863
+ end
864
+
865
+ i0, s0 = index, []
866
+ r1 = _nt_comment
867
+ s0 << r1
868
+ if r1
869
+ r2 = _nt_tags
870
+ s0 << r2
871
+ if r2
872
+ r3 = _nt_white
873
+ s0 << r3
874
+ if r3
875
+ r4 = _nt_scenario_outline_keyword
876
+ s0 << r4
877
+ if r4
878
+ s5, i5 = [], index
879
+ loop do
880
+ r6 = _nt_space
881
+ if r6
882
+ s5 << r6
883
+ else
884
+ break
885
+ end
886
+ end
887
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
888
+ s0 << r5
889
+ if r5
890
+ r7 = _nt_lines_to_keyword
891
+ s0 << r7
892
+ if r7
893
+ r8 = _nt_white
894
+ s0 << r8
895
+ if r8
896
+ r9 = _nt_steps
897
+ s0 << r9
898
+ if r9
899
+ r10 = _nt_examples_sections
900
+ s0 << r10
901
+ if r10
902
+ r11 = _nt_white
903
+ s0 << r11
904
+ end
905
+ end
906
+ end
907
+ end
908
+ end
909
+ end
910
+ end
911
+ end
912
+ end
913
+ if s0.last
914
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
915
+ r0.extend(ScenarioOutline0)
916
+ r0.extend(ScenarioOutline1)
917
+ else
918
+ @index = i0
919
+ r0 = nil
920
+ end
921
+
922
+ node_cache[:scenario_outline][start_index] = r0
923
+
924
+ r0
925
+ end
926
+
927
+ module Steps0
928
+ def at_line?(line)
929
+ elements.detect{|e| e.at_line?(line)}
930
+ end
931
+
932
+ def build
933
+ elements.map{|e| e.build}
934
+ end
935
+ end
936
+
937
+ def _nt_steps
938
+ start_index = index
939
+ if node_cache[:steps].has_key?(index)
940
+ cached = node_cache[:steps][index]
941
+ @index = cached.interval.end if cached
942
+ return cached
943
+ end
944
+
945
+ s0, i0 = [], index
946
+ loop do
947
+ r1 = _nt_step
948
+ if r1
949
+ s0 << r1
950
+ else
951
+ break
952
+ end
953
+ end
954
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
955
+ r0.extend(Steps0)
956
+
957
+ node_cache[:steps][start_index] = r0
958
+
959
+ r0
960
+ end
961
+
962
+ module Step0
963
+ def comment
964
+ elements[0]
965
+ end
966
+
967
+ def step_keyword
968
+ elements[2]
969
+ end
970
+
971
+ def name
972
+ elements[4]
973
+ end
974
+
975
+ def multi
976
+ elements[6]
977
+ end
978
+
979
+ def white
980
+ elements[7]
981
+ end
982
+ end
983
+
984
+ module Step1
985
+ def at_line?(line)
986
+ step_keyword.line == line ||
987
+ (multi.respond_to?(:at_line?) && multi.at_line?(line))
988
+ end
989
+
990
+ def build
991
+ if multi.respond_to?(:build)
992
+ Ast::Step.new(step_keyword.line, step_keyword.text_value.strip, name.text_value.strip, multi.build)
993
+ else
994
+ Ast::Step.new(step_keyword.line, step_keyword.text_value.strip, name.text_value.strip)
995
+ end
996
+ end
997
+ end
998
+
999
+ def _nt_step
1000
+ start_index = index
1001
+ if node_cache[:step].has_key?(index)
1002
+ cached = node_cache[:step][index]
1003
+ @index = cached.interval.end if cached
1004
+ return cached
1005
+ end
1006
+
1007
+ i0, s0 = index, []
1008
+ r1 = _nt_comment
1009
+ s0 << r1
1010
+ if r1
1011
+ s2, i2 = [], index
1012
+ loop do
1013
+ r3 = _nt_space
1014
+ if r3
1015
+ s2 << r3
1016
+ else
1017
+ break
1018
+ end
1019
+ end
1020
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1021
+ s0 << r2
1022
+ if r2
1023
+ r4 = _nt_step_keyword
1024
+ s0 << r4
1025
+ if r4
1026
+ s5, i5 = [], index
1027
+ loop do
1028
+ r6 = _nt_space
1029
+ if r6
1030
+ s5 << r6
1031
+ else
1032
+ break
1033
+ end
1034
+ end
1035
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1036
+ s0 << r5
1037
+ if r5
1038
+ r7 = _nt_line_to_eol
1039
+ s0 << r7
1040
+ if r7
1041
+ i8 = index
1042
+ s9, i9 = [], index
1043
+ loop do
1044
+ r10 = _nt_eol
1045
+ if r10
1046
+ s9 << r10
1047
+ else
1048
+ break
1049
+ end
1050
+ end
1051
+ if s9.empty?
1052
+ @index = i9
1053
+ r9 = nil
1054
+ else
1055
+ r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
1056
+ end
1057
+ if r9
1058
+ r8 = r9
1059
+ else
1060
+ r11 = _nt_eof
1061
+ if r11
1062
+ r8 = r11
1063
+ else
1064
+ @index = i8
1065
+ r8 = nil
1066
+ end
1067
+ end
1068
+ s0 << r8
1069
+ if r8
1070
+ r13 = _nt_multiline_arg
1071
+ if r13
1072
+ r12 = r13
1073
+ else
1074
+ r12 = instantiate_node(SyntaxNode,input, index...index)
1075
+ end
1076
+ s0 << r12
1077
+ if r12
1078
+ r14 = _nt_white
1079
+ s0 << r14
1080
+ end
1081
+ end
1082
+ end
1083
+ end
1084
+ end
1085
+ end
1086
+ end
1087
+ if s0.last
1088
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1089
+ r0.extend(Step0)
1090
+ r0.extend(Step1)
1091
+ else
1092
+ @index = i0
1093
+ r0 = nil
1094
+ end
1095
+
1096
+ node_cache[:step][start_index] = r0
1097
+
1098
+ r0
1099
+ end
1100
+
1101
+ module ExamplesSections0
1102
+ def at_line?(line)
1103
+ elements.detect { |e| e.at_line?(line) }
1104
+ end
1105
+
1106
+ def matches_name?(regexp_to_match)
1107
+ elements.detect { |e| e.matches_name?(regexp_to_match) }
1108
+ end
1109
+
1110
+ def build(filter, scenario_outline)
1111
+ elements.map do |e|
1112
+ if(filter.nil? || filter.accept_example?(e, scenario_outline))
1113
+ e.build(filter, scenario_outline)
1114
+ end
1115
+ end.compact
1116
+ end
1117
+ end
1118
+
1119
+ def _nt_examples_sections
1120
+ start_index = index
1121
+ if node_cache[:examples_sections].has_key?(index)
1122
+ cached = node_cache[:examples_sections][index]
1123
+ @index = cached.interval.end if cached
1124
+ return cached
1125
+ end
1126
+
1127
+ s0, i0 = [], index
1128
+ loop do
1129
+ r1 = _nt_examples
1130
+ if r1
1131
+ s0 << r1
1132
+ else
1133
+ break
1134
+ end
1135
+ end
1136
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1137
+ r0.extend(ExamplesSections0)
1138
+
1139
+ node_cache[:examples_sections][start_index] = r0
1140
+
1141
+ r0
1142
+ end
1143
+
1144
+ module Examples0
1145
+ def comment
1146
+ elements[0]
1147
+ end
1148
+
1149
+ def examples_keyword
1150
+ elements[2]
1151
+ end
1152
+
1153
+ def name
1154
+ elements[4]
1155
+ end
1156
+
1157
+ def eol
1158
+ elements[5]
1159
+ end
1160
+
1161
+ def table
1162
+ elements[6]
1163
+ end
1164
+
1165
+ def white
1166
+ elements[7]
1167
+ end
1168
+ end
1169
+
1170
+ module Examples1
1171
+ def at_line?(line)
1172
+ examples_keyword.line == line ||
1173
+ table.at_line?(line)
1174
+ end
1175
+
1176
+ def matches_tags?(tag_names)
1177
+ true
1178
+ end
1179
+
1180
+ def outline_at_line?(line)
1181
+ true
1182
+ end
1183
+
1184
+ def matches_name?(regexp_to_match)
1185
+ name.build =~ regexp_to_match
1186
+ end
1187
+
1188
+ def build(filter, scenario_outline)
1189
+ [comment.build, examples_keyword.line, examples_keyword.text_value, name.build, table.raw(filter, scenario_outline)]
1190
+ end
1191
+ end
1192
+
1193
+ def _nt_examples
1194
+ start_index = index
1195
+ if node_cache[:examples].has_key?(index)
1196
+ cached = node_cache[:examples][index]
1197
+ @index = cached.interval.end if cached
1198
+ return cached
1199
+ end
1200
+
1201
+ i0, s0 = index, []
1202
+ r1 = _nt_comment
1203
+ s0 << r1
1204
+ if r1
1205
+ s2, i2 = [], index
1206
+ loop do
1207
+ r3 = _nt_space
1208
+ if r3
1209
+ s2 << r3
1210
+ else
1211
+ break
1212
+ end
1213
+ end
1214
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1215
+ s0 << r2
1216
+ if r2
1217
+ r4 = _nt_examples_keyword
1218
+ s0 << r4
1219
+ if r4
1220
+ s5, i5 = [], index
1221
+ loop do
1222
+ r6 = _nt_space
1223
+ if r6
1224
+ s5 << r6
1225
+ else
1226
+ break
1227
+ end
1228
+ end
1229
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1230
+ s0 << r5
1231
+ if r5
1232
+ r8 = _nt_lines_to_keyword
1233
+ if r8
1234
+ r7 = r8
1235
+ else
1236
+ r7 = instantiate_node(SyntaxNode,input, index...index)
1237
+ end
1238
+ s0 << r7
1239
+ if r7
1240
+ r9 = _nt_eol
1241
+ s0 << r9
1242
+ if r9
1243
+ r10 = _nt_table
1244
+ s0 << r10
1245
+ if r10
1246
+ r11 = _nt_white
1247
+ s0 << r11
1248
+ end
1249
+ end
1250
+ end
1251
+ end
1252
+ end
1253
+ end
1254
+ end
1255
+ if s0.last
1256
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1257
+ r0.extend(Examples0)
1258
+ r0.extend(Examples1)
1259
+ else
1260
+ @index = i0
1261
+ r0 = nil
1262
+ end
1263
+
1264
+ node_cache[:examples][start_index] = r0
1265
+
1266
+ r0
1267
+ end
1268
+
1269
+ def _nt_multiline_arg
1270
+ start_index = index
1271
+ if node_cache[:multiline_arg].has_key?(index)
1272
+ cached = node_cache[:multiline_arg][index]
1273
+ @index = cached.interval.end if cached
1274
+ return cached
1275
+ end
1276
+
1277
+ i0 = index
1278
+ r1 = _nt_table
1279
+ if r1
1280
+ r0 = r1
1281
+ else
1282
+ r2 = _nt_py_string
1283
+ if r2
1284
+ r0 = r2
1285
+ else
1286
+ @index = i0
1287
+ r0 = nil
1288
+ end
1289
+ end
1290
+
1291
+ node_cache[:multiline_arg][start_index] = r0
1292
+
1293
+ r0
1294
+ end
1295
+
1296
+ module LineToEol0
1297
+ end
1298
+
1299
+ def _nt_line_to_eol
1300
+ start_index = index
1301
+ if node_cache[:line_to_eol].has_key?(index)
1302
+ cached = node_cache[:line_to_eol][index]
1303
+ @index = cached.interval.end if cached
1304
+ return cached
1305
+ end
1306
+
1307
+ s0, i0 = [], index
1308
+ loop do
1309
+ i1, s1 = index, []
1310
+ i2 = index
1311
+ r3 = _nt_eol
1312
+ if r3
1313
+ r2 = nil
1314
+ else
1315
+ @index = i2
1316
+ r2 = instantiate_node(SyntaxNode,input, index...index)
1317
+ end
1318
+ s1 << r2
1319
+ if r2
1320
+ if index < input_length
1321
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
1322
+ @index += 1
1323
+ else
1324
+ terminal_parse_failure("any character")
1325
+ r4 = nil
1326
+ end
1327
+ s1 << r4
1328
+ end
1329
+ if s1.last
1330
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1331
+ r1.extend(LineToEol0)
1332
+ else
1333
+ @index = i1
1334
+ r1 = nil
1335
+ end
1336
+ if r1
1337
+ s0 << r1
1338
+ else
1339
+ break
1340
+ end
1341
+ end
1342
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1343
+
1344
+ node_cache[:line_to_eol][start_index] = r0
1345
+
1346
+ r0
1347
+ end
1348
+
1349
+ module LinesToKeyword0
1350
+ def eol
1351
+ elements[0]
1352
+ end
1353
+
1354
+ def reserved_words_and_symbols
1355
+ elements[2]
1356
+ end
1357
+ end
1358
+
1359
+ module LinesToKeyword1
1360
+ end
1361
+
1362
+ module LinesToKeyword2
1363
+ def build
1364
+ self.text_value.split("\n").map{|s| s.strip}.join("\n")
1365
+ end
1366
+ end
1367
+
1368
+ def _nt_lines_to_keyword
1369
+ start_index = index
1370
+ if node_cache[:lines_to_keyword].has_key?(index)
1371
+ cached = node_cache[:lines_to_keyword][index]
1372
+ @index = cached.interval.end if cached
1373
+ return cached
1374
+ end
1375
+
1376
+ s0, i0 = [], index
1377
+ loop do
1378
+ i1, s1 = index, []
1379
+ i2 = index
1380
+ i3, s3 = index, []
1381
+ r4 = _nt_eol
1382
+ s3 << r4
1383
+ if r4
1384
+ s5, i5 = [], index
1385
+ loop do
1386
+ r6 = _nt_space
1387
+ if r6
1388
+ s5 << r6
1389
+ else
1390
+ break
1391
+ end
1392
+ end
1393
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1394
+ s3 << r5
1395
+ if r5
1396
+ r7 = _nt_reserved_words_and_symbols
1397
+ s3 << r7
1398
+ end
1399
+ end
1400
+ if s3.last
1401
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
1402
+ r3.extend(LinesToKeyword0)
1403
+ else
1404
+ @index = i3
1405
+ r3 = nil
1406
+ end
1407
+ if r3
1408
+ r2 = nil
1409
+ else
1410
+ @index = i2
1411
+ r2 = instantiate_node(SyntaxNode,input, index...index)
1412
+ end
1413
+ s1 << r2
1414
+ if r2
1415
+ if index < input_length
1416
+ r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
1417
+ @index += 1
1418
+ else
1419
+ terminal_parse_failure("any character")
1420
+ r8 = nil
1421
+ end
1422
+ s1 << r8
1423
+ end
1424
+ if s1.last
1425
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1426
+ r1.extend(LinesToKeyword1)
1427
+ else
1428
+ @index = i1
1429
+ r1 = nil
1430
+ end
1431
+ if r1
1432
+ s0 << r1
1433
+ else
1434
+ break
1435
+ end
1436
+ end
1437
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1438
+ r0.extend(LinesToKeyword2)
1439
+
1440
+ node_cache[:lines_to_keyword][start_index] = r0
1441
+
1442
+ r0
1443
+ end
1444
+
1445
+ def _nt_reserved_words_and_symbols
1446
+ start_index = index
1447
+ if node_cache[:reserved_words_and_symbols].has_key?(index)
1448
+ cached = node_cache[:reserved_words_and_symbols][index]
1449
+ @index = cached.interval.end if cached
1450
+ return cached
1451
+ end
1452
+
1453
+ i0 = index
1454
+ r1 = _nt_step_keyword
1455
+ if r1
1456
+ r0 = r1
1457
+ else
1458
+ r2 = _nt_scenario_keyword
1459
+ if r2
1460
+ r0 = r2
1461
+ else
1462
+ r3 = _nt_scenario_outline_keyword
1463
+ if r3
1464
+ r0 = r3
1465
+ else
1466
+ r4 = _nt_table
1467
+ if r4
1468
+ r0 = r4
1469
+ else
1470
+ r5 = _nt_tag
1471
+ if r5
1472
+ r0 = r5
1473
+ else
1474
+ r6 = _nt_comment_line
1475
+ if r6
1476
+ r0 = r6
1477
+ else
1478
+ @index = i0
1479
+ r0 = nil
1480
+ end
1481
+ end
1482
+ end
1483
+ end
1484
+ end
1485
+ end
1486
+
1487
+ node_cache[:reserved_words_and_symbols][start_index] = r0
1488
+
1489
+ r0
1490
+ end
1491
+
1492
+ module PyString0
1493
+ end
1494
+
1495
+ module PyString1
1496
+ def open_py_string
1497
+ elements[0]
1498
+ end
1499
+
1500
+ def s
1501
+ elements[1]
1502
+ end
1503
+
1504
+ def close_py_string
1505
+ elements[2]
1506
+ end
1507
+ end
1508
+
1509
+ module PyString2
1510
+ def at_line?(line)
1511
+ line >= open_py_string.line && line <= close_py_string.line
1512
+ end
1513
+
1514
+ def build
1515
+ Ast::PyString.new(open_py_string.line, close_py_string.line, s.text_value, open_py_string.indentation)
1516
+ end
1517
+ end
1518
+
1519
+ def _nt_py_string
1520
+ start_index = index
1521
+ if node_cache[:py_string].has_key?(index)
1522
+ cached = node_cache[:py_string][index]
1523
+ @index = cached.interval.end if cached
1524
+ return cached
1525
+ end
1526
+
1527
+ i0, s0 = index, []
1528
+ r1 = _nt_open_py_string
1529
+ s0 << r1
1530
+ if r1
1531
+ s2, i2 = [], index
1532
+ loop do
1533
+ i3, s3 = index, []
1534
+ i4 = index
1535
+ r5 = _nt_close_py_string
1536
+ if r5
1537
+ r4 = nil
1538
+ else
1539
+ @index = i4
1540
+ r4 = instantiate_node(SyntaxNode,input, index...index)
1541
+ end
1542
+ s3 << r4
1543
+ if r4
1544
+ if index < input_length
1545
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
1546
+ @index += 1
1547
+ else
1548
+ terminal_parse_failure("any character")
1549
+ r6 = nil
1550
+ end
1551
+ s3 << r6
1552
+ end
1553
+ if s3.last
1554
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
1555
+ r3.extend(PyString0)
1556
+ else
1557
+ @index = i3
1558
+ r3 = nil
1559
+ end
1560
+ if r3
1561
+ s2 << r3
1562
+ else
1563
+ break
1564
+ end
1565
+ end
1566
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1567
+ s0 << r2
1568
+ if r2
1569
+ r7 = _nt_close_py_string
1570
+ s0 << r7
1571
+ end
1572
+ end
1573
+ if s0.last
1574
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1575
+ r0.extend(PyString1)
1576
+ r0.extend(PyString2)
1577
+ else
1578
+ @index = i0
1579
+ r0 = nil
1580
+ end
1581
+
1582
+ node_cache[:py_string][start_index] = r0
1583
+
1584
+ r0
1585
+ end
1586
+
1587
+ module OpenPyString0
1588
+ def indent
1589
+ elements[0]
1590
+ end
1591
+
1592
+ def eol
1593
+ elements[3]
1594
+ end
1595
+ end
1596
+
1597
+ module OpenPyString1
1598
+ def indentation
1599
+ indent.text_value.length
1600
+ end
1601
+
1602
+ def line
1603
+ indent.line
1604
+ end
1605
+ end
1606
+
1607
+ def _nt_open_py_string
1608
+ start_index = index
1609
+ if node_cache[:open_py_string].has_key?(index)
1610
+ cached = node_cache[:open_py_string][index]
1611
+ @index = cached.interval.end if cached
1612
+ return cached
1613
+ end
1614
+
1615
+ i0, s0 = index, []
1616
+ s1, i1 = [], index
1617
+ loop do
1618
+ r2 = _nt_space
1619
+ if r2
1620
+ s1 << r2
1621
+ else
1622
+ break
1623
+ end
1624
+ end
1625
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1626
+ s0 << r1
1627
+ if r1
1628
+ if has_terminal?('"""', false, index)
1629
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 3))
1630
+ @index += 3
1631
+ else
1632
+ terminal_parse_failure('"""')
1633
+ r3 = nil
1634
+ end
1635
+ s0 << r3
1636
+ if r3
1637
+ s4, i4 = [], index
1638
+ loop do
1639
+ r5 = _nt_space
1640
+ if r5
1641
+ s4 << r5
1642
+ else
1643
+ break
1644
+ end
1645
+ end
1646
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
1647
+ s0 << r4
1648
+ if r4
1649
+ r6 = _nt_eol
1650
+ s0 << r6
1651
+ end
1652
+ end
1653
+ end
1654
+ if s0.last
1655
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1656
+ r0.extend(OpenPyString0)
1657
+ r0.extend(OpenPyString1)
1658
+ else
1659
+ @index = i0
1660
+ r0 = nil
1661
+ end
1662
+
1663
+ node_cache[:open_py_string][start_index] = r0
1664
+
1665
+ r0
1666
+ end
1667
+
1668
+ module ClosePyString0
1669
+ def eol
1670
+ elements[0]
1671
+ end
1672
+
1673
+ def quotes
1674
+ elements[2]
1675
+ end
1676
+
1677
+ def white
1678
+ elements[3]
1679
+ end
1680
+ end
1681
+
1682
+ module ClosePyString1
1683
+ def line
1684
+ quotes.line
1685
+ end
1686
+ end
1687
+
1688
+ def _nt_close_py_string
1689
+ start_index = index
1690
+ if node_cache[:close_py_string].has_key?(index)
1691
+ cached = node_cache[:close_py_string][index]
1692
+ @index = cached.interval.end if cached
1693
+ return cached
1694
+ end
1695
+
1696
+ i0, s0 = index, []
1697
+ r1 = _nt_eol
1698
+ s0 << r1
1699
+ if r1
1700
+ s2, i2 = [], index
1701
+ loop do
1702
+ r3 = _nt_space
1703
+ if r3
1704
+ s2 << r3
1705
+ else
1706
+ break
1707
+ end
1708
+ end
1709
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1710
+ s0 << r2
1711
+ if r2
1712
+ if has_terminal?('"""', false, index)
1713
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 3))
1714
+ @index += 3
1715
+ else
1716
+ terminal_parse_failure('"""')
1717
+ r4 = nil
1718
+ end
1719
+ s0 << r4
1720
+ if r4
1721
+ r5 = _nt_white
1722
+ s0 << r5
1723
+ end
1724
+ end
1725
+ end
1726
+ if s0.last
1727
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1728
+ r0.extend(ClosePyString0)
1729
+ r0.extend(ClosePyString1)
1730
+ else
1731
+ @index = i0
1732
+ r0 = nil
1733
+ end
1734
+
1735
+ node_cache[:close_py_string][start_index] = r0
1736
+
1737
+ r0
1738
+ end
1739
+
1740
+ def _nt_white
1741
+ start_index = index
1742
+ if node_cache[:white].has_key?(index)
1743
+ cached = node_cache[:white][index]
1744
+ @index = cached.interval.end if cached
1745
+ return cached
1746
+ end
1747
+
1748
+ s0, i0 = [], index
1749
+ loop do
1750
+ i1 = index
1751
+ r2 = _nt_space
1752
+ if r2
1753
+ r1 = r2
1754
+ else
1755
+ r3 = _nt_eol
1756
+ if r3
1757
+ r1 = r3
1758
+ else
1759
+ @index = i1
1760
+ r1 = nil
1761
+ end
1762
+ end
1763
+ if r1
1764
+ s0 << r1
1765
+ else
1766
+ break
1767
+ end
1768
+ end
1769
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1770
+
1771
+ node_cache[:white][start_index] = r0
1772
+
1773
+ r0
1774
+ end
1775
+
1776
+ end
1777
+
1778
+ class FeatureParser < Treetop::Runtime::CompiledParser
1779
+ include Feature
1780
+ end
1781
+
1782
+ end
1783
+ end