kosmas58-cucumber 0.1.99.21 → 0.1.99.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. metadata +17 -300
  2. data/History.txt +0 -513
  3. data/License.txt +0 -20
  4. data/Manifest.txt +0 -0
  5. data/README.txt +0 -4
  6. data/Rakefile +0 -9
  7. data/bin/cucumber +0 -6
  8. data/config/hoe.rb +0 -75
  9. data/config/requirements.rb +0 -15
  10. data/cucumber.yml +0 -3
  11. data/examples/cs/README.textile +0 -1
  12. data/examples/cs/Rakefile +0 -12
  13. data/examples/cs/compile.bat +0 -1
  14. data/examples/cs/features/addition.feature +0 -16
  15. data/examples/cs/features/step_definitons/calculator_steps.rb +0 -19
  16. data/examples/cs/src/demo/Calculator.cs +0 -20
  17. data/examples/dos_line_endings/Rakefile +0 -6
  18. data/examples/dos_line_endings/features/dos_line_endings.feature +0 -9
  19. data/examples/i18n/README.textile +0 -18
  20. data/examples/i18n/Rakefile +0 -32
  21. data/examples/i18n/ar/Rakefile +0 -6
  22. data/examples/i18n/ar/features/addition.feature +0 -17
  23. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +0 -28
  24. data/examples/i18n/ar/lib/calculator.rb +0 -10
  25. data/examples/i18n/da/Rakefile +0 -6
  26. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +0 -24
  27. data/examples/i18n/da/features/summering.feature +0 -17
  28. data/examples/i18n/da/lib/kalkulator.rb +0 -11
  29. data/examples/i18n/de/Rakefile +0 -6
  30. data/examples/i18n/de/features/addition.feature +0 -16
  31. data/examples/i18n/de/features/division.feature +0 -9
  32. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +0 -24
  33. data/examples/i18n/de/lib/calculator.rb +0 -14
  34. data/examples/i18n/en/Rakefile +0 -6
  35. data/examples/i18n/en/features/addition.feature +0 -16
  36. data/examples/i18n/en/features/division.feature +0 -9
  37. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +0 -24
  38. data/examples/i18n/en/lib/calculator.rb +0 -14
  39. data/examples/i18n/es/Rakefile +0 -6
  40. data/examples/i18n/es/features/adicion.feature +0 -16
  41. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +0 -21
  42. data/examples/i18n/es/lib/calculador.rb +0 -14
  43. data/examples/i18n/et/Rakefile +0 -6
  44. data/examples/i18n/et/features/liitmine.feature +0 -17
  45. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +0 -24
  46. data/examples/i18n/et/lib/kalkulaator.rb +0 -10
  47. data/examples/i18n/fi/Rakefile +0 -6
  48. data/examples/i18n/fi/features/jakolasku.feature +0 -9
  49. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +0 -24
  50. data/examples/i18n/fi/features/yhteenlasku.feature +0 -16
  51. data/examples/i18n/fi/lib/laskin.rb +0 -14
  52. data/examples/i18n/fr/Rakefile +0 -6
  53. data/examples/i18n/fr/features/addition.feature +0 -15
  54. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +0 -27
  55. data/examples/i18n/fr/lib/calculatrice.rb +0 -10
  56. data/examples/i18n/id/Rakefile +0 -6
  57. data/examples/i18n/id/features/addition.feature +0 -16
  58. data/examples/i18n/id/features/division.feature +0 -9
  59. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +0 -24
  60. data/examples/i18n/id/lib/calculator.rb +0 -14
  61. data/examples/i18n/it/Rakefile +0 -6
  62. data/examples/i18n/it/features/somma.feature +0 -10
  63. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +0 -24
  64. data/examples/i18n/it/lib/calcolatrice.rb +0 -11
  65. data/examples/i18n/ja/README.txt +0 -5
  66. data/examples/i18n/ja/Rakefile +0 -6
  67. data/examples/i18n/ja/features/addition.feature +0 -16
  68. data/examples/i18n/ja/features/division.feature +0 -9
  69. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +0 -24
  70. data/examples/i18n/ja/lib/calculator.rb +0 -14
  71. data/examples/i18n/ko/Rakefile +0 -6
  72. data/examples/i18n/ko/features/addition.feature +0 -16
  73. data/examples/i18n/ko/features/division.feature +0 -10
  74. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +0 -24
  75. data/examples/i18n/ko/lib/calculator.rb +0 -14
  76. data/examples/i18n/lt/Rakefile +0 -6
  77. data/examples/i18n/lt/features/addition.feature +0 -17
  78. data/examples/i18n/lt/features/division.feature +0 -9
  79. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +0 -24
  80. data/examples/i18n/lt/lib/calculator.rb +0 -14
  81. data/examples/i18n/no/Rakefile +0 -6
  82. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +0 -24
  83. data/examples/i18n/no/features/summering.feature +0 -18
  84. data/examples/i18n/no/lib/kalkulator.rb +0 -11
  85. data/examples/i18n/pt/Rakefile +0 -6
  86. data/examples/i18n/pt/features/adicao.feature +0 -10
  87. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +0 -24
  88. data/examples/i18n/pt/lib/calculadora.rb +0 -10
  89. data/examples/i18n/ro/Rakefile +0 -6
  90. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +0 -24
  91. data/examples/i18n/ro/features/suma.feature +0 -10
  92. data/examples/i18n/ro/lib/calculator.rb +0 -11
  93. data/examples/i18n/se/Rakefile +0 -6
  94. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +0 -24
  95. data/examples/i18n/se/features/summering.feature +0 -17
  96. data/examples/i18n/se/lib/kalkulator.rb +0 -11
  97. data/examples/i18n/zh-CN/Rakefile +0 -6
  98. data/examples/i18n/zh-CN/features/addition.feature +0 -17
  99. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +0 -26
  100. data/examples/i18n/zh-CN/lib/calculator.rb +0 -10
  101. data/examples/java/README.textile +0 -22
  102. data/examples/java/Rakefile +0 -12
  103. data/examples/java/features/hello.feature +0 -11
  104. data/examples/java/features/step_definitons/hello_steps.rb +0 -25
  105. data/examples/java/features/step_definitons/tree_steps.rb +0 -14
  106. data/examples/java/features/tree.feature +0 -9
  107. data/examples/java/src/cucumber/demo/Hello.java +0 -16
  108. data/examples/jbehave/README.textile +0 -17
  109. data/examples/jbehave/features/support/env.rb +0 -7
  110. data/examples/jbehave/features/trading.feature +0 -24
  111. data/examples/jbehave/pom.xml +0 -48
  112. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/converters/TraderConverter.java +0 -32
  113. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Stock.java +0 -42
  114. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java +0 -29
  115. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java +0 -22
  116. data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +0 -65
  117. data/examples/selenium/Rakefile +0 -6
  118. data/examples/selenium/features/search.feature +0 -9
  119. data/examples/selenium/features/step_definitons/stories_steps.rb +0 -40
  120. data/examples/self_test/README.textile +0 -6
  121. data/examples/self_test/Rakefile +0 -6
  122. data/examples/self_test/features/background/failing_background.feature +0 -10
  123. data/examples/self_test/features/background/failing_background_after_success.feature +0 -11
  124. data/examples/self_test/features/background/multiline_args_background.feature +0 -32
  125. data/examples/self_test/features/background/passing_background.feature +0 -10
  126. data/examples/self_test/features/background/pending_background.feature +0 -10
  127. data/examples/self_test/features/background/scenario_outline_failing_background.feature +0 -16
  128. data/examples/self_test/features/background/scenario_outline_passing_background.feature +0 -16
  129. data/examples/self_test/features/call_undefined_step_from_step_def.feature +0 -7
  130. data/examples/self_test/features/lots_of_undefined.feature +0 -8
  131. data/examples/self_test/features/outline_sample.feature +0 -15
  132. data/examples/self_test/features/sample.feature +0 -19
  133. data/examples/self_test/features/step_definitions/sample_steps.rb +0 -62
  134. data/examples/self_test/features/support/env.rb +0 -1
  135. data/examples/self_test/features/support/tag_count_formatter.rb +0 -25
  136. data/examples/test_unit/Rakefile +0 -6
  137. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +0 -26
  138. data/examples/test_unit/features/test_unit.feature +0 -9
  139. data/examples/tickets/Rakefile +0 -11
  140. data/examples/tickets/cucumber.yml +0 -2
  141. data/examples/tickets/features/172.feature +0 -28
  142. data/examples/tickets/features/177/1.feature +0 -29
  143. data/examples/tickets/features/177/2.feature +0 -21
  144. data/examples/tickets/features/177/3.feature +0 -18
  145. data/examples/tickets/features/180.feature +0 -7
  146. data/examples/tickets/features/lib/eatting_machine.rb +0 -18
  147. data/examples/tickets/features/lib/pantry.rb +0 -20
  148. data/examples/tickets/features/scenario_outline.feature +0 -95
  149. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +0 -42
  150. data/examples/tickets/features/step_definitons/tickets_steps.rb +0 -60
  151. data/examples/tickets/features/tickets.feature +0 -28
  152. data/examples/watir/README.textile +0 -16
  153. data/examples/watir/Rakefile +0 -6
  154. data/examples/watir/features/search.feature +0 -9
  155. data/examples/watir/features/step_definitons/search_steps.rb +0 -24
  156. data/examples/watir/features/support/env.rb +0 -32
  157. data/features/background.feature +0 -223
  158. data/features/cucumber_cli.feature +0 -343
  159. data/features/cucumber_cli_outlines.feature +0 -90
  160. data/features/custom_formatter.feature +0 -11
  161. data/features/report_called_undefined_steps.feature +0 -32
  162. data/features/step_definitions/cucumber_steps.rb +0 -31
  163. data/features/step_definitions/extra_steps.rb +0 -2
  164. data/features/support/env.rb +0 -8
  165. data/gem_tasks/deployment.rake +0 -11
  166. data/gem_tasks/environment.rake +0 -7
  167. data/gem_tasks/features.rake +0 -9
  168. data/gem_tasks/fix_cr_lf.rake +0 -10
  169. data/gem_tasks/flog.rake +0 -4
  170. data/gem_tasks/gemspec.rake +0 -10
  171. data/gem_tasks/jar.rake +0 -67
  172. data/gem_tasks/rspec.rake +0 -38
  173. data/gem_tasks/yard.rake +0 -8
  174. data/lib/autotest/cucumber.rb +0 -6
  175. data/lib/autotest/cucumber_mixin.rb +0 -124
  176. data/lib/autotest/cucumber_rails.rb +0 -6
  177. data/lib/autotest/cucumber_rails_rspec.rb +0 -6
  178. data/lib/autotest/cucumber_rspec.rb +0 -6
  179. data/lib/autotest/discover.rb +0 -9
  180. data/lib/cucumber/ast/background.rb +0 -88
  181. data/lib/cucumber/ast/comment.rb +0 -26
  182. data/lib/cucumber/ast/examples.rb +0 -26
  183. data/lib/cucumber/ast/feature.rb +0 -66
  184. data/lib/cucumber/ast/features.rb +0 -39
  185. data/lib/cucumber/ast/filter.rb +0 -22
  186. data/lib/cucumber/ast/outline_table.rb +0 -49
  187. data/lib/cucumber/ast/py_string.rb +0 -52
  188. data/lib/cucumber/ast/scenario.rb +0 -103
  189. data/lib/cucumber/ast/scenario_outline.rb +0 -92
  190. data/lib/cucumber/ast/step.rb +0 -161
  191. data/lib/cucumber/ast/steps.rb +0 -13
  192. data/lib/cucumber/ast/table.rb +0 -218
  193. data/lib/cucumber/ast/tags.rb +0 -40
  194. data/lib/cucumber/ast/visitor.rb +0 -109
  195. data/lib/cucumber/ast.rb +0 -29
  196. data/lib/cucumber/broadcaster.rb +0 -15
  197. data/lib/cucumber/cli/configuration.rb +0 -339
  198. data/lib/cucumber/cli/language_help_formatter.rb +0 -59
  199. data/lib/cucumber/cli/main.rb +0 -100
  200. data/lib/cucumber/core_ext/exception.rb +0 -53
  201. data/lib/cucumber/core_ext/instance_exec.rb +0 -54
  202. data/lib/cucumber/core_ext/proc.rb +0 -33
  203. data/lib/cucumber/core_ext/string.rb +0 -48
  204. data/lib/cucumber/formatter/ansicolor.rb +0 -103
  205. data/lib/cucumber/formatter/color_io.rb +0 -17
  206. data/lib/cucumber/formatter/console.rb +0 -119
  207. data/lib/cucumber/formatter/cucumber.css +0 -55
  208. data/lib/cucumber/formatter/cucumber.sass +0 -49
  209. data/lib/cucumber/formatter/html.rb +0 -121
  210. data/lib/cucumber/formatter/pretty.rb +0 -167
  211. data/lib/cucumber/formatter/profile.rb +0 -77
  212. data/lib/cucumber/formatter/progress.rb +0 -68
  213. data/lib/cucumber/formatter/rerun.rb +0 -35
  214. data/lib/cucumber/formatter/unicode.rb +0 -35
  215. data/lib/cucumber/formatter.rb +0 -1
  216. data/lib/cucumber/formatters/unicode.rb +0 -2
  217. data/lib/cucumber/jbehave.rb +0 -102
  218. data/lib/cucumber/languages.yml +0 -339
  219. data/lib/cucumber/parser/basic.rb +0 -0
  220. data/lib/cucumber/parser/feature.rb +0 -1490
  221. data/lib/cucumber/parser/feature.tt +0 -188
  222. data/lib/cucumber/parser/i18n.tt +0 -31
  223. data/lib/cucumber/parser/table.rb +0 -402
  224. data/lib/cucumber/parser/table.tt +0 -59
  225. data/lib/cucumber/parser/treetop_ext.rb +0 -75
  226. data/lib/cucumber/parser.rb +0 -43
  227. data/lib/cucumber/platform.rb +0 -18
  228. data/lib/cucumber/rails/rspec.rb +0 -8
  229. data/lib/cucumber/rails/world.rb +0 -73
  230. data/lib/cucumber/rake/task.rb +0 -111
  231. data/lib/cucumber/step_definition.rb +0 -87
  232. data/lib/cucumber/step_mother.rb +0 -183
  233. data/lib/cucumber/version.rb +0 -10
  234. data/lib/cucumber.rb +0 -71
  235. data/rails_generators/cucumber/USAGE +0 -14
  236. data/rails_generators/cucumber/cucumber_generator.rb +0 -54
  237. data/rails_generators/cucumber/templates/cucumber +0 -8
  238. data/rails_generators/cucumber/templates/cucumber.rake +0 -12
  239. data/rails_generators/cucumber/templates/env.rb +0 -16
  240. data/rails_generators/cucumber/templates/paths.rb +0 -12
  241. data/rails_generators/cucumber/templates/webrat_steps.rb +0 -99
  242. data/rails_generators/feature/USAGE +0 -15
  243. data/rails_generators/feature/feature_generator.rb +0 -60
  244. data/rails_generators/feature/templates/feature.erb +0 -31
  245. data/rails_generators/feature/templates/steps.erb +0 -24
  246. data/spec/cucumber/ast/background_spec.rb +0 -58
  247. data/spec/cucumber/ast/feature_factory.rb +0 -54
  248. data/spec/cucumber/ast/feature_spec.rb +0 -60
  249. data/spec/cucumber/ast/py_string_spec.rb +0 -40
  250. data/spec/cucumber/ast/scenario_outline_spec.rb +0 -64
  251. data/spec/cucumber/ast/scenario_spec.rb +0 -82
  252. data/spec/cucumber/ast/step_spec.rb +0 -45
  253. data/spec/cucumber/ast/table_spec.rb +0 -81
  254. data/spec/cucumber/ast/tags_spec.rb +0 -23
  255. data/spec/cucumber/broadcaster_spec.rb +0 -14
  256. data/spec/cucumber/cli/configuration_spec.rb +0 -239
  257. data/spec/cucumber/cli/main_spec.rb +0 -164
  258. data/spec/cucumber/core_ext/proc_spec.rb +0 -37
  259. data/spec/cucumber/core_ext/string_spec.rb +0 -42
  260. data/spec/cucumber/formatter/ansicolor_spec.rb +0 -35
  261. data/spec/cucumber/formatter/html/cucumber.css +0 -37
  262. data/spec/cucumber/formatter/html/cucumber.js +0 -13
  263. data/spec/cucumber/formatter/html/index.html +0 -45
  264. data/spec/cucumber/formatter/html/jquery-1.3.min.js +0 -19
  265. data/spec/cucumber/formatter/html/jquery.uitableedit.js +0 -100
  266. data/spec/cucumber/formatters/profile_formatter_spec.rb +0 -198
  267. data/spec/cucumber/parser/feature_parser_spec.rb +0 -281
  268. data/spec/cucumber/parser/table_parser_spec.rb +0 -48
  269. data/spec/cucumber/rails/stubs/mini_rails.rb +0 -18
  270. data/spec/cucumber/rails/stubs/test_help.rb +0 -1
  271. data/spec/cucumber/rails/world_spec.rb +0 -11
  272. data/spec/cucumber/sell_cucumbers.feature +0 -19
  273. data/spec/cucumber/step_definition_spec.rb +0 -62
  274. data/spec/cucumber/step_mother_spec.rb +0 -73
  275. data/spec/cucumber/treetop_parser/empty_feature.feature +0 -4
  276. data/spec/cucumber/treetop_parser/empty_scenario.feature +0 -9
  277. data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +0 -3
  278. data/spec/cucumber/treetop_parser/fit_scenario.feature +0 -8
  279. data/spec/cucumber/treetop_parser/given_scenario.feature +0 -9
  280. data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +0 -7
  281. data/spec/cucumber/treetop_parser/multiline_steps.feature +0 -17
  282. data/spec/cucumber/treetop_parser/multiple_tables.feature +0 -27
  283. data/spec/cucumber/treetop_parser/scenario_outline.feature +0 -16
  284. data/spec/cucumber/treetop_parser/spaces.feature +0 -12
  285. data/spec/cucumber/treetop_parser/test_dos.feature +0 -25
  286. data/spec/cucumber/treetop_parser/with_comments.feature +0 -10
  287. data/spec/cucumber/treetop_parser/with_tags.feature +0 -18
  288. data/spec/cucumber/world/pending_spec.rb +0 -47
  289. data/spec/spec.opts +0 -3
  290. data/spec/spec_helper.rb +0 -21
@@ -1,188 +0,0 @@
1
- module Cucumber
2
- module Parser
3
- # TIP: When you hack on the grammar, just delete feature.rb in this directory.
4
- # Also make sure you have uninstalled all cucumber gems (don't forget xxx-cucumber
5
- # github gems).
6
- #
7
- # Treetop will then generate the parser in-memory. When you're happy, just generate
8
- # the rb file with tt feature.tt
9
- grammar Feature
10
- include I18n
11
- include Table
12
-
13
- rule feature
14
- white
15
- comment
16
- white
17
- tags
18
- white
19
- header:(!(scenario_outline / scenario / background) .)*
20
- background:(background)?
21
- feature_elements
22
- comment? {
23
- def build
24
- if background.respond_to?(:build)
25
- Ast::Feature.new(comment.build, tags.build, header.text_value, feature_elements.build, background.build)
26
- else
27
- Ast::Feature.new(comment.build, tags.build, header.text_value, feature_elements.build)
28
- end
29
- end
30
- }
31
- end
32
-
33
- rule tags
34
- white ts:(tag (space/eol)+)* {
35
- def build
36
- tag_names = ts.elements.map{|e| e.tag.tag_name.text_value}
37
- Ast::Tags.new(ts.line, tag_names)
38
- end
39
- }
40
- end
41
-
42
- rule tag
43
- '@' tag_name:([a-z0-9])+
44
- end
45
-
46
- rule comment
47
- (comment_line white)* {
48
- def build
49
- Ast::Comment.new(text_value)
50
- end
51
- }
52
- end
53
-
54
- rule comment_line
55
- '#' line_to_eol
56
- end
57
-
58
- rule background
59
- comment white background_keyword space* (eol+ / eof) steps {
60
- def build
61
- Ast::Background.new(
62
- comment.build,
63
- background_keyword.line,
64
- background_keyword.text_value,
65
- steps.build
66
- )
67
- end
68
- }
69
- end
70
-
71
- rule feature_elements
72
- (scenario / scenario_outline)* {
73
- def build
74
- elements.map{|s| s.build}
75
- end
76
- }
77
- end
78
-
79
- rule scenario
80
- comment tags white scenario_keyword space* name:line_to_eol (white / eof) steps white {
81
- def build
82
- Ast::Scenario.new(
83
- comment.build,
84
- tags.build,
85
- scenario_keyword.line,
86
- scenario_keyword.text_value,
87
- name.text_value,
88
- steps.build
89
- )
90
- end
91
- }
92
- end
93
-
94
- rule scenario_outline
95
- comment tags white scenario_outline_keyword space* name:line_to_eol white steps examples_sections white {
96
- def build
97
- Ast::ScenarioOutline.new(
98
- comment.build,
99
- tags.build,
100
- scenario_outline_keyword.line,
101
- scenario_outline_keyword.text_value,
102
- name.text_value,
103
- steps.build,
104
- examples_sections.build
105
- )
106
- end
107
- }
108
- end
109
-
110
- rule steps
111
- step* {
112
- def build
113
- elements.map{|e| e.build}
114
- end
115
- }
116
- end
117
-
118
- rule step
119
- comment space* step_keyword space* name:line_to_eol (eol+ / eof) multi:multiline_arg? white {
120
- def build
121
- if multi.respond_to?(:build)
122
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip, multi.build)
123
- else
124
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip)
125
- end
126
- end
127
- }
128
- end
129
-
130
- rule examples_sections
131
- examples* {
132
- def build
133
- elements.map{|e| e.build}
134
- end
135
- }
136
- end
137
-
138
- rule examples
139
- space* examples_keyword space* name:line_to_eol? eol table white {
140
- def build
141
- [examples_keyword.line, examples_keyword.text_value, name.text_value, table.raw]
142
- end
143
- }
144
- end
145
-
146
- rule multiline_arg
147
- table / py_string
148
- end
149
-
150
- rule line_to_eol
151
- (!eol .)*
152
- end
153
-
154
- rule py_string
155
- open_py_string s:(!close_py_string .)* close_py_string {
156
- def build
157
- Ast::PyString.new(open_py_string.line, close_py_string.line, s.text_value, open_py_string.indentation)
158
- end
159
- }
160
- end
161
-
162
- rule open_py_string
163
- white '"""' space* eol {
164
- def indentation
165
- white.text_value.length
166
- end
167
-
168
- def line
169
- white.line
170
- end
171
- }
172
- end
173
-
174
- rule close_py_string
175
- eol space* quotes:'"""' white {
176
- def line
177
- quotes.line
178
- end
179
- }
180
- end
181
-
182
- rule white
183
- (space / eol)*
184
- end
185
-
186
- end
187
- end
188
- end
@@ -1,31 +0,0 @@
1
- module Cucumber
2
- module Parser
3
- grammar I18n
4
-
5
- rule background_keyword
6
- (<%= keywords('background') %>) ':'
7
- end
8
-
9
- rule scenario_keyword
10
- (<%= keywords('scenario') %>) ':'
11
- end
12
-
13
- rule scenario_outline_keyword
14
- (<%= keywords('scenario_outline') %>) ':'
15
- end
16
-
17
- rule step_keyword
18
- (<%= keywords('given') %>) /
19
- (<%= keywords('when') %>) /
20
- (<%= keywords('then') %>) /
21
- (<%= keywords('and') %>) /
22
- (<%= keywords('but') %>)
23
- end
24
-
25
- rule examples_keyword
26
- (<%= keywords('examples') %>) ':'?
27
- end
28
-
29
- end
30
- end
31
- end
@@ -1,402 +0,0 @@
1
- module Cucumber
2
- module Parser
3
- # TIP: When you hack on the grammar, just delete feature.rb in this directory.
4
- # Also make sure you have uninstalled all cucumber gems (don't forget xxx-cucumber
5
- # github gems).
6
- #
7
- # Treetop will then generate the parser in-memory. When you're happy, just generate
8
- # the rb file with tt feature.tt
9
- module Table
10
- include Treetop::Runtime
11
-
12
- def root
13
- @root || :table
14
- end
15
-
16
- module Table0
17
- def build
18
- Ast::Table.new(raw)
19
- end
20
-
21
- def raw
22
- elements.map{|e| e.build}
23
- end
24
- end
25
-
26
- def _nt_table
27
- start_index = index
28
- if node_cache[:table].has_key?(index)
29
- cached = node_cache[:table][index]
30
- @index = cached.interval.end if cached
31
- return cached
32
- end
33
-
34
- s0, i0 = [], index
35
- loop do
36
- r1 = _nt_table_row
37
- if r1
38
- s0 << r1
39
- else
40
- break
41
- end
42
- end
43
- if s0.empty?
44
- self.index = i0
45
- r0 = nil
46
- else
47
- r0 = SyntaxNode.new(input, i0...index, s0)
48
- r0.extend(Table0)
49
- end
50
-
51
- node_cache[:table][start_index] = r0
52
-
53
- return r0
54
- end
55
-
56
- module TableRow0
57
- def cell
58
- elements[0]
59
- end
60
-
61
- end
62
-
63
- module TableRow1
64
- def cells
65
- elements[2]
66
- end
67
-
68
- end
69
-
70
- module TableRow2
71
- def build
72
- row = cells.elements.map do |elt|
73
- value = elt.cell.text_value.strip
74
- value.empty? ? nil : value
75
- end
76
-
77
- class << row
78
- attr_accessor :line
79
- end
80
- row.line = cells.line
81
-
82
- row
83
- end
84
- end
85
-
86
- def _nt_table_row
87
- start_index = index
88
- if node_cache[:table_row].has_key?(index)
89
- cached = node_cache[:table_row][index]
90
- @index = cached.interval.end if cached
91
- return cached
92
- end
93
-
94
- i0, s0 = index, []
95
- s1, i1 = [], index
96
- loop do
97
- r2 = _nt_space
98
- if r2
99
- s1 << r2
100
- else
101
- break
102
- end
103
- end
104
- r1 = SyntaxNode.new(input, i1...index, s1)
105
- s0 << r1
106
- if r1
107
- if input.index('|', index) == index
108
- r3 = (SyntaxNode).new(input, index...(index + 1))
109
- @index += 1
110
- else
111
- terminal_parse_failure('|')
112
- r3 = nil
113
- end
114
- s0 << r3
115
- if r3
116
- s4, i4 = [], index
117
- loop do
118
- i5, s5 = index, []
119
- r6 = _nt_cell
120
- s5 << r6
121
- if r6
122
- if input.index('|', index) == index
123
- r7 = (SyntaxNode).new(input, index...(index + 1))
124
- @index += 1
125
- else
126
- terminal_parse_failure('|')
127
- r7 = nil
128
- end
129
- s5 << r7
130
- end
131
- if s5.last
132
- r5 = (SyntaxNode).new(input, i5...index, s5)
133
- r5.extend(TableRow0)
134
- else
135
- self.index = i5
136
- r5 = nil
137
- end
138
- if r5
139
- s4 << r5
140
- else
141
- break
142
- end
143
- end
144
- if s4.empty?
145
- self.index = i4
146
- r4 = nil
147
- else
148
- r4 = SyntaxNode.new(input, i4...index, s4)
149
- end
150
- s0 << r4
151
- if r4
152
- s8, i8 = [], index
153
- loop do
154
- r9 = _nt_space
155
- if r9
156
- s8 << r9
157
- else
158
- break
159
- end
160
- end
161
- r8 = SyntaxNode.new(input, i8...index, s8)
162
- s0 << r8
163
- if r8
164
- i10 = index
165
- s11, i11 = [], index
166
- loop do
167
- r12 = _nt_eol
168
- if r12
169
- s11 << r12
170
- else
171
- break
172
- end
173
- end
174
- if s11.empty?
175
- self.index = i11
176
- r11 = nil
177
- else
178
- r11 = SyntaxNode.new(input, i11...index, s11)
179
- end
180
- if r11
181
- r10 = r11
182
- else
183
- r13 = _nt_eof
184
- if r13
185
- r10 = r13
186
- else
187
- self.index = i10
188
- r10 = nil
189
- end
190
- end
191
- s0 << r10
192
- end
193
- end
194
- end
195
- end
196
- if s0.last
197
- r0 = (SyntaxNode).new(input, i0...index, s0)
198
- r0.extend(TableRow1)
199
- r0.extend(TableRow2)
200
- else
201
- self.index = i0
202
- r0 = nil
203
- end
204
-
205
- node_cache[:table_row][start_index] = r0
206
-
207
- return r0
208
- end
209
-
210
- module Cell0
211
- end
212
-
213
- def _nt_cell
214
- start_index = index
215
- if node_cache[:cell].has_key?(index)
216
- cached = node_cache[:cell][index]
217
- @index = cached.interval.end if cached
218
- return cached
219
- end
220
-
221
- s0, i0 = [], index
222
- loop do
223
- i1, s1 = index, []
224
- i2 = index
225
- i3 = index
226
- if input.index('|', index) == index
227
- r4 = (SyntaxNode).new(input, index...(index + 1))
228
- @index += 1
229
- else
230
- terminal_parse_failure('|')
231
- r4 = nil
232
- end
233
- if r4
234
- r3 = r4
235
- else
236
- r5 = _nt_eol
237
- if r5
238
- r3 = r5
239
- else
240
- self.index = i3
241
- r3 = nil
242
- end
243
- end
244
- if r3
245
- r2 = nil
246
- else
247
- self.index = i2
248
- r2 = SyntaxNode.new(input, index...index)
249
- end
250
- s1 << r2
251
- if r2
252
- if index < input_length
253
- r6 = (SyntaxNode).new(input, index...(index + 1))
254
- @index += 1
255
- else
256
- terminal_parse_failure("any character")
257
- r6 = nil
258
- end
259
- s1 << r6
260
- end
261
- if s1.last
262
- r1 = (SyntaxNode).new(input, i1...index, s1)
263
- r1.extend(Cell0)
264
- else
265
- self.index = i1
266
- r1 = nil
267
- end
268
- if r1
269
- s0 << r1
270
- else
271
- break
272
- end
273
- end
274
- r0 = SyntaxNode.new(input, i0...index, s0)
275
-
276
- node_cache[:cell][start_index] = r0
277
-
278
- return r0
279
- end
280
-
281
- def _nt_space
282
- start_index = index
283
- if node_cache[:space].has_key?(index)
284
- cached = node_cache[:space][index]
285
- @index = cached.interval.end if cached
286
- return cached
287
- end
288
-
289
- if input.index(Regexp.new('[ \\t]'), index) == index
290
- r0 = (SyntaxNode).new(input, index...(index + 1))
291
- @index += 1
292
- else
293
- r0 = nil
294
- end
295
-
296
- node_cache[:space][start_index] = r0
297
-
298
- return r0
299
- end
300
-
301
- module Eol0
302
- end
303
-
304
- def _nt_eol
305
- start_index = index
306
- if node_cache[:eol].has_key?(index)
307
- cached = node_cache[:eol][index]
308
- @index = cached.interval.end if cached
309
- return cached
310
- end
311
-
312
- i0 = index
313
- if input.index("\n", index) == index
314
- r1 = (SyntaxNode).new(input, index...(index + 1))
315
- @index += 1
316
- else
317
- terminal_parse_failure("\n")
318
- r1 = nil
319
- end
320
- if r1
321
- r0 = r1
322
- else
323
- i2, s2 = index, []
324
- if input.index("\r", index) == index
325
- r3 = (SyntaxNode).new(input, index...(index + 1))
326
- @index += 1
327
- else
328
- terminal_parse_failure("\r")
329
- r3 = nil
330
- end
331
- s2 << r3
332
- if r3
333
- if input.index("\n", index) == index
334
- r5 = (SyntaxNode).new(input, index...(index + 1))
335
- @index += 1
336
- else
337
- terminal_parse_failure("\n")
338
- r5 = nil
339
- end
340
- if r5
341
- r4 = r5
342
- else
343
- r4 = SyntaxNode.new(input, index...index)
344
- end
345
- s2 << r4
346
- end
347
- if s2.last
348
- r2 = (SyntaxNode).new(input, i2...index, s2)
349
- r2.extend(Eol0)
350
- else
351
- self.index = i2
352
- r2 = nil
353
- end
354
- if r2
355
- r0 = r2
356
- else
357
- self.index = i0
358
- r0 = nil
359
- end
360
- end
361
-
362
- node_cache[:eol][start_index] = r0
363
-
364
- return r0
365
- end
366
-
367
- def _nt_eof
368
- start_index = index
369
- if node_cache[:eof].has_key?(index)
370
- cached = node_cache[:eof][index]
371
- @index = cached.interval.end if cached
372
- return cached
373
- end
374
-
375
- i0 = index
376
- if index < input_length
377
- r1 = (SyntaxNode).new(input, index...(index + 1))
378
- @index += 1
379
- else
380
- terminal_parse_failure("any character")
381
- r1 = nil
382
- end
383
- if r1
384
- r0 = nil
385
- else
386
- self.index = i0
387
- r0 = SyntaxNode.new(input, index...index)
388
- end
389
-
390
- node_cache[:eof][start_index] = r0
391
-
392
- return r0
393
- end
394
-
395
- end
396
-
397
- class TableParser < Treetop::Runtime::CompiledParser
398
- include Table
399
- end
400
-
401
- end
402
- end
@@ -1,59 +0,0 @@
1
- module Cucumber
2
- module Parser
3
- # TIP: When you hack on the grammar, just delete feature.rb in this directory.
4
- # Also make sure you have uninstalled all cucumber gems (don't forget xxx-cucumber
5
- # github gems).
6
- #
7
- # Treetop will then generate the parser in-memory. When you're happy, just generate
8
- # the rb file with tt feature.tt
9
- grammar Table
10
-
11
- rule table
12
- table_row+ {
13
- def build
14
- Ast::Table.new(raw)
15
- end
16
-
17
- def raw
18
- elements.map{|e| e.build}
19
- end
20
- }
21
- end
22
-
23
- rule table_row
24
- space* '|' cells:(cell '|')+ space* (eol+ / eof) {
25
- def build
26
- row = cells.elements.map do |elt|
27
- value = elt.cell.text_value.strip
28
- value.empty? ? nil : value
29
- end
30
-
31
- class << row
32
- attr_accessor :line
33
- end
34
- row.line = cells.line
35
-
36
- row
37
- end
38
- }
39
- end
40
-
41
- rule cell
42
- (!('|' / eol) .)*
43
- end
44
-
45
- rule space
46
- [ \t]
47
- end
48
-
49
- rule eol
50
- "\n" / ("\r" "\n"?)
51
- end
52
-
53
- rule eof
54
- !.
55
- end
56
-
57
- end
58
- end
59
- end