aslakhellesoy-cucumber 0.1.99.3 → 0.1.99.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. data/Manifest.txt +6 -0
  2. metadata +1 -1
  3. data/cucumber.yml +0 -1
  4. data/examples/cs/README.textile +0 -1
  5. data/examples/cs/Rakefile +0 -12
  6. data/examples/cs/compile.bat +0 -1
  7. data/examples/cs/features/addition.feature +0 -16
  8. data/examples/cs/features/step_definitons/calculator_steps.rb +0 -19
  9. data/examples/cs/src/demo/Calculator.cs +0 -20
  10. data/examples/dos_line_endings/Rakefile +0 -6
  11. data/examples/dos_line_endings/features/dos_line_endings.feature +0 -9
  12. data/examples/i18n/README.textile +0 -18
  13. data/examples/i18n/Rakefile +0 -32
  14. data/examples/i18n/ar/Rakefile +0 -6
  15. data/examples/i18n/ar/features/addition.feature +0 -17
  16. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +0 -28
  17. data/examples/i18n/ar/lib/calculator.rb +0 -10
  18. data/examples/i18n/da/Rakefile +0 -6
  19. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +0 -24
  20. data/examples/i18n/da/features/summering.feature +0 -17
  21. data/examples/i18n/da/lib/kalkulator.rb +0 -11
  22. data/examples/i18n/de/Rakefile +0 -6
  23. data/examples/i18n/de/features/addition.feature +0 -16
  24. data/examples/i18n/de/features/division.feature +0 -9
  25. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +0 -24
  26. data/examples/i18n/de/lib/calculator.rb +0 -14
  27. data/examples/i18n/en/Rakefile +0 -6
  28. data/examples/i18n/en/features/addition.feature +0 -16
  29. data/examples/i18n/en/features/division.feature +0 -9
  30. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +0 -24
  31. data/examples/i18n/en/lib/calculator.rb +0 -14
  32. data/examples/i18n/es/Rakefile +0 -6
  33. data/examples/i18n/es/features/adicion.feature +0 -17
  34. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +0 -24
  35. data/examples/i18n/es/lib/calculador.rb +0 -11
  36. data/examples/i18n/et/Rakefile +0 -6
  37. data/examples/i18n/et/features/liitmine.feature +0 -17
  38. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +0 -24
  39. data/examples/i18n/et/lib/kalkulaator.rb +0 -10
  40. data/examples/i18n/fi/Rakefile +0 -6
  41. data/examples/i18n/fi/features/jakolasku.feature +0 -9
  42. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +0 -24
  43. data/examples/i18n/fi/features/yhteenlasku.feature +0 -16
  44. data/examples/i18n/fi/lib/laskin.rb +0 -14
  45. data/examples/i18n/fr/Rakefile +0 -6
  46. data/examples/i18n/fr/features/addition.feature +0 -15
  47. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +0 -27
  48. data/examples/i18n/fr/lib/calculatrice.rb +0 -10
  49. data/examples/i18n/id/Rakefile +0 -6
  50. data/examples/i18n/id/features/addition.feature +0 -16
  51. data/examples/i18n/id/features/division.feature +0 -9
  52. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +0 -24
  53. data/examples/i18n/id/lib/calculator.rb +0 -14
  54. data/examples/i18n/it/Rakefile +0 -6
  55. data/examples/i18n/it/features/somma.feature +0 -10
  56. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +0 -24
  57. data/examples/i18n/it/lib/calcolatrice.rb +0 -11
  58. data/examples/i18n/ja/README.txt +0 -5
  59. data/examples/i18n/ja/Rakefile +0 -6
  60. data/examples/i18n/ja/features/addition.feature +0 -16
  61. data/examples/i18n/ja/features/division.feature +0 -9
  62. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +0 -24
  63. data/examples/i18n/ja/lib/calculator.rb +0 -14
  64. data/examples/i18n/ko/Rakefile +0 -6
  65. data/examples/i18n/ko/features/addition.feature +0 -16
  66. data/examples/i18n/ko/features/division.feature +0 -10
  67. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +0 -24
  68. data/examples/i18n/ko/lib/calculator.rb +0 -14
  69. data/examples/i18n/lt/Rakefile +0 -6
  70. data/examples/i18n/lt/features/addition.feature +0 -17
  71. data/examples/i18n/lt/features/division.feature +0 -9
  72. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +0 -24
  73. data/examples/i18n/lt/lib/calculator.rb +0 -14
  74. data/examples/i18n/no/Rakefile +0 -6
  75. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +0 -24
  76. data/examples/i18n/no/features/summering.feature +0 -18
  77. data/examples/i18n/no/lib/kalkulator.rb +0 -11
  78. data/examples/i18n/pt/Rakefile +0 -6
  79. data/examples/i18n/pt/features/adicao.feature +0 -10
  80. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +0 -24
  81. data/examples/i18n/pt/lib/calculadora.rb +0 -10
  82. data/examples/i18n/ro/Rakefile +0 -6
  83. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +0 -24
  84. data/examples/i18n/ro/features/suma.feature +0 -10
  85. data/examples/i18n/ro/lib/calculator.rb +0 -11
  86. data/examples/i18n/se/Rakefile +0 -6
  87. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +0 -24
  88. data/examples/i18n/se/features/summering.feature +0 -17
  89. data/examples/i18n/se/lib/kalkulator.rb +0 -11
  90. data/examples/i18n/zh-CN/Rakefile +0 -6
  91. data/examples/i18n/zh-CN/features/addition.feature +0 -17
  92. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +0 -26
  93. data/examples/i18n/zh-CN/lib/calculator.rb +0 -10
  94. data/examples/java/README.textile +0 -22
  95. data/examples/java/Rakefile +0 -12
  96. data/examples/java/features/hello.feature +0 -11
  97. data/examples/java/features/step_definitons/hello_steps.rb +0 -25
  98. data/examples/java/features/step_definitons/tree_steps.rb +0 -14
  99. data/examples/java/features/tree.feature +0 -9
  100. data/examples/jbehave/README.textile +0 -17
  101. data/examples/jbehave/features/support/env.rb +0 -7
  102. data/examples/jbehave/features/trading.feature +0 -24
  103. data/examples/jbehave/pom.xml +0 -48
  104. data/examples/selenium/Rakefile +0 -6
  105. data/examples/selenium/features/search.feature +0 -9
  106. data/examples/selenium/features/step_definitons/stories_steps.rb +0 -40
  107. data/examples/self_test/README.textile +0 -6
  108. data/examples/self_test/features/call_undefined_step_from_step_def.feature +0 -7
  109. data/examples/self_test/features/lots_of_undefined.feature +0 -8
  110. data/examples/self_test/features/outline_sample.feature +0 -12
  111. data/examples/self_test/features/sample.feature +0 -16
  112. data/examples/self_test/features/step_definitions/sample_steps.rb +0 -25
  113. data/examples/test_unit/Rakefile +0 -6
  114. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +0 -26
  115. data/examples/test_unit/features/test_unit.feature +0 -9
  116. data/examples/tickets/Rakefile +0 -11
  117. data/examples/tickets/cucumber.yml +0 -2
  118. data/examples/tickets/features/lib/eatting_machine.rb +0 -18
  119. data/examples/tickets/features/lib/pantry.rb +0 -20
  120. data/examples/tickets/features/scenario_outline.feature +0 -90
  121. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +0 -42
  122. data/examples/tickets/features/step_definitons/tickets_steps.rb +0 -61
  123. data/examples/tickets/features/tickets.feature +0 -28
  124. data/examples/watir/README.textile +0 -16
  125. data/examples/watir/Rakefile +0 -6
  126. data/examples/watir/features/search.feature +0 -9
  127. data/examples/watir/features/step_definitons/search_steps.rb +0 -24
  128. data/examples/watir/features/support/env.rb +0 -32
  129. data/features/cucumber_cli.feature +0 -327
  130. data/features/cucumber_cli_outlines.feature +0 -81
  131. data/features/report_called_undefined_steps.feature +0 -32
  132. data/features/step_definitions/cucumber_steps.rb +0 -31
  133. data/features/step_definitions/extra_steps.rb +0 -2
  134. data/features/support/env.rb +0 -7
  135. data/gem_tasks/deployment.rake +0 -11
  136. data/gem_tasks/environment.rake +0 -7
  137. data/gem_tasks/features.rake +0 -6
  138. data/gem_tasks/fix_cr_lf.rake +0 -10
  139. data/gem_tasks/flog.rake +0 -4
  140. data/gem_tasks/gemspec.rake +0 -10
  141. data/gem_tasks/rspec.rake +0 -35
  142. data/gem_tasks/yard.rake +0 -8
  143. data/lib/autotest/cucumber.rb +0 -6
  144. data/lib/autotest/cucumber_mixin.rb +0 -124
  145. data/lib/autotest/cucumber_rails.rb +0 -6
  146. data/lib/autotest/cucumber_rails_rspec.rb +0 -6
  147. data/lib/autotest/cucumber_rspec.rb +0 -6
  148. data/lib/autotest/discover.rb +0 -9
  149. data/lib/cucumber/ast/comment.rb +0 -26
  150. data/lib/cucumber/ast/examples.rb +0 -22
  151. data/lib/cucumber/ast/feature.rb +0 -60
  152. data/lib/cucumber/ast/features.rb +0 -39
  153. data/lib/cucumber/ast/filter.rb +0 -22
  154. data/lib/cucumber/ast/outline_table.rb +0 -49
  155. data/lib/cucumber/ast/py_string.rb +0 -52
  156. data/lib/cucumber/ast/scenario.rb +0 -95
  157. data/lib/cucumber/ast/scenario_outline.rb +0 -83
  158. data/lib/cucumber/ast/step.rb +0 -139
  159. data/lib/cucumber/ast/table.rb +0 -214
  160. data/lib/cucumber/ast/tags.rb +0 -33
  161. data/lib/cucumber/ast/visitor.rb +0 -93
  162. data/lib/cucumber/ast.rb +0 -27
  163. data/lib/cucumber/broadcaster.rb +0 -15
  164. data/lib/cucumber/cli.rb +0 -410
  165. data/lib/cucumber/core_ext/exception.rb +0 -53
  166. data/lib/cucumber/core_ext/instance_exec.rb +0 -54
  167. data/lib/cucumber/core_ext/proc.rb +0 -33
  168. data/lib/cucumber/core_ext/string.rb +0 -48
  169. data/lib/cucumber/formatter/ansicolor.rb +0 -106
  170. data/lib/cucumber/formatter/console.rb +0 -116
  171. data/lib/cucumber/formatter/pretty.rb +0 -158
  172. data/lib/cucumber/formatter/profile.rb +0 -77
  173. data/lib/cucumber/formatter/progress.rb +0 -68
  174. data/lib/cucumber/formatter/rerun.rb +0 -35
  175. data/lib/cucumber/formatter.rb +0 -1
  176. data/lib/cucumber/formatters/autotest_formatter.rb +0 -21
  177. data/lib/cucumber/formatters/cucumber.css +0 -132
  178. data/lib/cucumber/formatters/cucumber.js +0 -11
  179. data/lib/cucumber/formatters/html_formatter.rb +0 -152
  180. data/lib/cucumber/formatters/jquery.js +0 -32
  181. data/lib/cucumber/formatters/pretty_formatter.rb +0 -285
  182. data/lib/cucumber/formatters/unicode.rb +0 -35
  183. data/lib/cucumber/jbehave.rb +0 -104
  184. data/lib/cucumber/languages.yml +0 -314
  185. data/lib/cucumber/parser/basic.rb +0 -0
  186. data/lib/cucumber/parser/feature.rb +0 -1315
  187. data/lib/cucumber/parser/feature.tt +0 -160
  188. data/lib/cucumber/parser/i18n.tt +0 -27
  189. data/lib/cucumber/parser/table.rb +0 -396
  190. data/lib/cucumber/parser/table.tt +0 -53
  191. data/lib/cucumber/parser/treetop_ext.rb +0 -67
  192. data/lib/cucumber/parser.rb +0 -24
  193. data/lib/cucumber/platform.rb +0 -18
  194. data/lib/cucumber/rails/rspec.rb +0 -5
  195. data/lib/cucumber/rails/world.rb +0 -73
  196. data/lib/cucumber/rake/task.rb +0 -106
  197. data/lib/cucumber/step_definition.rb +0 -87
  198. data/lib/cucumber/step_mother.rb +0 -164
  199. data/lib/cucumber/treetop_parser/feature_fi.rb +0 -1951
  200. data/lib/cucumber/version.rb +0 -10
  201. data/lib/cucumber.rb +0 -72
  202. data/pretty.txt +0 -486
  203. data/rails_generators/cucumber/USAGE +0 -11
  204. data/rails_generators/cucumber/cucumber_generator.rb +0 -31
  205. data/rails_generators/cucumber/templates/cucumber +0 -8
  206. data/rails_generators/cucumber/templates/cucumber.rake +0 -7
  207. data/rails_generators/cucumber/templates/env.rb +0 -16
  208. data/rails_generators/cucumber/templates/paths.rb +0 -12
  209. data/rails_generators/cucumber/templates/webrat_steps.rb +0 -99
  210. data/rails_generators/feature/USAGE +0 -12
  211. data/rails_generators/feature/feature_generator.rb +0 -36
  212. data/rails_generators/feature/templates/feature.erb +0 -31
  213. data/rails_generators/feature/templates/steps.erb +0 -24
  214. data/spec/cucumber/ast/feature_factory.rb +0 -54
  215. data/spec/cucumber/ast/feature_spec.rb +0 -60
  216. data/spec/cucumber/ast/py_string_spec.rb +0 -40
  217. data/spec/cucumber/ast/scenario_outline_spec.rb +0 -64
  218. data/spec/cucumber/ast/scenario_spec.rb +0 -82
  219. data/spec/cucumber/ast/step_spec.rb +0 -45
  220. data/spec/cucumber/ast/table_spec.rb +0 -81
  221. data/spec/cucumber/broadcaster_spec.rb +0 -14
  222. data/spec/cucumber/cli_spec.rb +0 -416
  223. data/spec/cucumber/core_ext/proc_spec.rb +0 -37
  224. data/spec/cucumber/core_ext/string_spec.rb +0 -42
  225. data/spec/cucumber/formatter/ansicolor_spec.rb +0 -35
  226. data/spec/cucumber/formatter/html/cucumber.css +0 -37
  227. data/spec/cucumber/formatter/html/cucumber.js +0 -11
  228. data/spec/cucumber/formatter/html/index.html +0 -45
  229. data/spec/cucumber/formatter/html/jquery-1.3.min.js +0 -19
  230. data/spec/cucumber/formatter/html/jquery.uitableedit.js +0 -100
  231. data/spec/cucumber/formatters/autotest_formatter_spec.rb +0 -27
  232. data/spec/cucumber/formatters/features.html +0 -269
  233. data/spec/cucumber/formatters/profile_formatter_spec.rb +0 -198
  234. data/spec/cucumber/parser/feature_parser_spec.rb +0 -247
  235. data/spec/cucumber/parser/table_parser_spec.rb +0 -48
  236. data/spec/cucumber/rails/stubs/mini_rails.rb +0 -18
  237. data/spec/cucumber/rails/stubs/test_help.rb +0 -1
  238. data/spec/cucumber/rails/world_spec.rb +0 -11
  239. data/spec/cucumber/sell_cucumbers.feature +0 -19
  240. data/spec/cucumber/step_definition_spec.rb +0 -62
  241. data/spec/cucumber/step_mom_spec.rb +0 -49
  242. data/spec/cucumber/treetop_parser/empty_feature.feature +0 -4
  243. data/spec/cucumber/treetop_parser/empty_scenario.feature +0 -9
  244. data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +0 -3
  245. data/spec/cucumber/treetop_parser/fit_scenario.feature +0 -8
  246. data/spec/cucumber/treetop_parser/given_scenario.feature +0 -9
  247. data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +0 -7
  248. data/spec/cucumber/treetop_parser/multiline_steps.feature +0 -17
  249. data/spec/cucumber/treetop_parser/multiple_tables.feature +0 -27
  250. data/spec/cucumber/treetop_parser/scenario_outline.feature +0 -16
  251. data/spec/cucumber/treetop_parser/spaces.feature +0 -12
  252. data/spec/cucumber/treetop_parser/test_dos.feature +0 -25
  253. data/spec/cucumber/treetop_parser/with_comments.feature +0 -10
  254. data/spec/cucumber/treetop_parser/with_tags.feature +0 -18
  255. data/spec/cucumber/world/pending_spec.rb +0 -47
  256. data/spec/spec.opts +0 -2
  257. data/spec/spec_helper.rb +0 -21
@@ -1,1315 +0,0 @@
1
- module Cucumber
2
- module Parser
3
- # TIP: When you hack on the grammar, just delete feature.rb in this directory.
4
- # Treetop will then generate the parser in-memory. When you're happy, just generate
5
- # the rb file with tt feature.tt
6
- module Feature
7
- include Treetop::Runtime
8
-
9
- def root
10
- @root || :feature
11
- end
12
-
13
- include I18n
14
-
15
- include Table
16
-
17
- module Feature0
18
- end
19
-
20
- module Feature1
21
- def white
22
- elements[0]
23
- end
24
-
25
- def comment
26
- elements[1]
27
- end
28
-
29
- def white
30
- elements[2]
31
- end
32
-
33
- def tags
34
- elements[3]
35
- end
36
-
37
- def white
38
- elements[4]
39
- end
40
-
41
- def header
42
- elements[5]
43
- end
44
-
45
- def feature_elements
46
- elements[6]
47
- end
48
- end
49
-
50
- module Feature2
51
- def build
52
- Ast::Feature.new(comment.build, tags.build, header.text_value, feature_elements.build)
53
- end
54
- end
55
-
56
- def _nt_feature
57
- start_index = index
58
- if node_cache[:feature].has_key?(index)
59
- cached = node_cache[:feature][index]
60
- @index = cached.interval.end if cached
61
- return cached
62
- end
63
-
64
- i0, s0 = index, []
65
- r1 = _nt_white
66
- s0 << r1
67
- if r1
68
- r2 = _nt_comment
69
- s0 << r2
70
- if r2
71
- r3 = _nt_white
72
- s0 << r3
73
- if r3
74
- r4 = _nt_tags
75
- s0 << r4
76
- if r4
77
- r5 = _nt_white
78
- s0 << r5
79
- if r5
80
- s6, i6 = [], index
81
- loop do
82
- i7, s7 = index, []
83
- i8 = index
84
- i9 = index
85
- r10 = _nt_scenario_outline
86
- if r10
87
- r9 = r10
88
- else
89
- r11 = _nt_scenario
90
- if r11
91
- r9 = r11
92
- else
93
- self.index = i9
94
- r9 = nil
95
- end
96
- end
97
- if r9
98
- r8 = nil
99
- else
100
- self.index = i8
101
- r8 = SyntaxNode.new(input, index...index)
102
- end
103
- s7 << r8
104
- if r8
105
- if index < input_length
106
- r12 = (SyntaxNode).new(input, index...(index + 1))
107
- @index += 1
108
- else
109
- terminal_parse_failure("any character")
110
- r12 = nil
111
- end
112
- s7 << r12
113
- end
114
- if s7.last
115
- r7 = (SyntaxNode).new(input, i7...index, s7)
116
- r7.extend(Feature0)
117
- else
118
- self.index = i7
119
- r7 = nil
120
- end
121
- if r7
122
- s6 << r7
123
- else
124
- break
125
- end
126
- end
127
- r6 = SyntaxNode.new(input, i6...index, s6)
128
- s0 << r6
129
- if r6
130
- r13 = _nt_feature_elements
131
- s0 << r13
132
- end
133
- end
134
- end
135
- end
136
- end
137
- end
138
- if s0.last
139
- r0 = (SyntaxNode).new(input, i0...index, s0)
140
- r0.extend(Feature1)
141
- r0.extend(Feature2)
142
- else
143
- self.index = i0
144
- r0 = nil
145
- end
146
-
147
- node_cache[:feature][start_index] = r0
148
-
149
- return r0
150
- end
151
-
152
- module Tags0
153
- def tag
154
- elements[0]
155
- end
156
-
157
- end
158
-
159
- module Tags1
160
- def white
161
- elements[0]
162
- end
163
-
164
- def ts
165
- elements[1]
166
- end
167
- end
168
-
169
- module Tags2
170
- def build
171
- tag_names = ts.elements.map{|e| e.tag.tag_name.text_value}
172
- Ast::Tags.new(ts.line, tag_names)
173
- end
174
- end
175
-
176
- def _nt_tags
177
- start_index = index
178
- if node_cache[:tags].has_key?(index)
179
- cached = node_cache[:tags][index]
180
- @index = cached.interval.end if cached
181
- return cached
182
- end
183
-
184
- i0, s0 = index, []
185
- r1 = _nt_white
186
- s0 << r1
187
- if r1
188
- s2, i2 = [], index
189
- loop do
190
- i3, s3 = index, []
191
- r4 = _nt_tag
192
- s3 << r4
193
- if r4
194
- s5, i5 = [], index
195
- loop do
196
- i6 = index
197
- r7 = _nt_space
198
- if r7
199
- r6 = r7
200
- else
201
- r8 = _nt_eol
202
- if r8
203
- r6 = r8
204
- else
205
- self.index = i6
206
- r6 = nil
207
- end
208
- end
209
- if r6
210
- s5 << r6
211
- else
212
- break
213
- end
214
- end
215
- if s5.empty?
216
- self.index = i5
217
- r5 = nil
218
- else
219
- r5 = SyntaxNode.new(input, i5...index, s5)
220
- end
221
- s3 << r5
222
- end
223
- if s3.last
224
- r3 = (SyntaxNode).new(input, i3...index, s3)
225
- r3.extend(Tags0)
226
- else
227
- self.index = i3
228
- r3 = nil
229
- end
230
- if r3
231
- s2 << r3
232
- else
233
- break
234
- end
235
- end
236
- r2 = SyntaxNode.new(input, i2...index, s2)
237
- s0 << r2
238
- end
239
- if s0.last
240
- r0 = (SyntaxNode).new(input, i0...index, s0)
241
- r0.extend(Tags1)
242
- r0.extend(Tags2)
243
- else
244
- self.index = i0
245
- r0 = nil
246
- end
247
-
248
- node_cache[:tags][start_index] = r0
249
-
250
- return r0
251
- end
252
-
253
- module Tag0
254
- def tag_name
255
- elements[1]
256
- end
257
- end
258
-
259
- def _nt_tag
260
- start_index = index
261
- if node_cache[:tag].has_key?(index)
262
- cached = node_cache[:tag][index]
263
- @index = cached.interval.end if cached
264
- return cached
265
- end
266
-
267
- i0, s0 = index, []
268
- if input.index('@', index) == index
269
- r1 = (SyntaxNode).new(input, index...(index + 1))
270
- @index += 1
271
- else
272
- terminal_parse_failure('@')
273
- r1 = nil
274
- end
275
- s0 << r1
276
- if r1
277
- s2, i2 = [], index
278
- loop do
279
- if input.index(Regexp.new('[a-z0-9]'), index) == index
280
- r3 = (SyntaxNode).new(input, index...(index + 1))
281
- @index += 1
282
- else
283
- r3 = nil
284
- end
285
- if r3
286
- s2 << r3
287
- else
288
- break
289
- end
290
- end
291
- if s2.empty?
292
- self.index = i2
293
- r2 = nil
294
- else
295
- r2 = SyntaxNode.new(input, i2...index, s2)
296
- end
297
- s0 << r2
298
- end
299
- if s0.last
300
- r0 = (SyntaxNode).new(input, i0...index, s0)
301
- r0.extend(Tag0)
302
- else
303
- self.index = i0
304
- r0 = nil
305
- end
306
-
307
- node_cache[:tag][start_index] = r0
308
-
309
- return r0
310
- end
311
-
312
- module Comment0
313
- def comment_line
314
- elements[0]
315
- end
316
-
317
- end
318
-
319
- module Comment1
320
- def build
321
- Ast::Comment.new(text_value)
322
- end
323
- end
324
-
325
- def _nt_comment
326
- start_index = index
327
- if node_cache[:comment].has_key?(index)
328
- cached = node_cache[:comment][index]
329
- @index = cached.interval.end if cached
330
- return cached
331
- end
332
-
333
- s0, i0 = [], index
334
- loop do
335
- i1, s1 = index, []
336
- r2 = _nt_comment_line
337
- s1 << r2
338
- if r2
339
- s3, i3 = [], index
340
- loop do
341
- r4 = _nt_eol
342
- if r4
343
- s3 << r4
344
- else
345
- break
346
- end
347
- end
348
- if s3.empty?
349
- self.index = i3
350
- r3 = nil
351
- else
352
- r3 = SyntaxNode.new(input, i3...index, s3)
353
- end
354
- s1 << r3
355
- end
356
- if s1.last
357
- r1 = (SyntaxNode).new(input, i1...index, s1)
358
- r1.extend(Comment0)
359
- else
360
- self.index = i1
361
- r1 = nil
362
- end
363
- if r1
364
- s0 << r1
365
- else
366
- break
367
- end
368
- end
369
- r0 = SyntaxNode.new(input, i0...index, s0)
370
- r0.extend(Comment1)
371
-
372
- node_cache[:comment][start_index] = r0
373
-
374
- return r0
375
- end
376
-
377
- module CommentLine0
378
- def line_to_eol
379
- elements[1]
380
- end
381
- end
382
-
383
- def _nt_comment_line
384
- start_index = index
385
- if node_cache[:comment_line].has_key?(index)
386
- cached = node_cache[:comment_line][index]
387
- @index = cached.interval.end if cached
388
- return cached
389
- end
390
-
391
- i0, s0 = index, []
392
- if input.index('#', index) == index
393
- r1 = (SyntaxNode).new(input, index...(index + 1))
394
- @index += 1
395
- else
396
- terminal_parse_failure('#')
397
- r1 = nil
398
- end
399
- s0 << r1
400
- if r1
401
- r2 = _nt_line_to_eol
402
- s0 << r2
403
- end
404
- if s0.last
405
- r0 = (SyntaxNode).new(input, i0...index, s0)
406
- r0.extend(CommentLine0)
407
- else
408
- self.index = i0
409
- r0 = nil
410
- end
411
-
412
- node_cache[:comment_line][start_index] = r0
413
-
414
- return r0
415
- end
416
-
417
- module FeatureElements0
418
- def build
419
- elements.map{|s| s.build}
420
- end
421
- end
422
-
423
- def _nt_feature_elements
424
- start_index = index
425
- if node_cache[:feature_elements].has_key?(index)
426
- cached = node_cache[:feature_elements][index]
427
- @index = cached.interval.end if cached
428
- return cached
429
- end
430
-
431
- s0, i0 = [], index
432
- loop do
433
- i1 = index
434
- r2 = _nt_scenario
435
- if r2
436
- r1 = r2
437
- else
438
- r3 = _nt_scenario_outline
439
- if r3
440
- r1 = r3
441
- else
442
- self.index = i1
443
- r1 = nil
444
- end
445
- end
446
- if r1
447
- s0 << r1
448
- else
449
- break
450
- end
451
- end
452
- r0 = SyntaxNode.new(input, i0...index, s0)
453
- r0.extend(FeatureElements0)
454
-
455
- node_cache[:feature_elements][start_index] = r0
456
-
457
- return r0
458
- end
459
-
460
- module Scenario0
461
- def comment
462
- elements[0]
463
- end
464
-
465
- def tags
466
- elements[1]
467
- end
468
-
469
- def white
470
- elements[2]
471
- end
472
-
473
- def scenario_keyword
474
- elements[3]
475
- end
476
-
477
- def name
478
- elements[5]
479
- end
480
-
481
- def steps
482
- elements[7]
483
- end
484
- end
485
-
486
- module Scenario1
487
- def build
488
- Ast::Scenario.new(
489
- comment.build,
490
- tags.build,
491
- scenario_keyword.line,
492
- scenario_keyword.text_value,
493
- name.text_value,
494
- steps.build
495
- )
496
- end
497
- end
498
-
499
- def _nt_scenario
500
- start_index = index
501
- if node_cache[:scenario].has_key?(index)
502
- cached = node_cache[:scenario][index]
503
- @index = cached.interval.end if cached
504
- return cached
505
- end
506
-
507
- i0, s0 = index, []
508
- r1 = _nt_comment
509
- s0 << r1
510
- if r1
511
- r2 = _nt_tags
512
- s0 << r2
513
- if r2
514
- r3 = _nt_white
515
- s0 << r3
516
- if r3
517
- r4 = _nt_scenario_keyword
518
- s0 << r4
519
- if r4
520
- s5, i5 = [], index
521
- loop do
522
- r6 = _nt_space
523
- if r6
524
- s5 << r6
525
- else
526
- break
527
- end
528
- end
529
- r5 = SyntaxNode.new(input, i5...index, s5)
530
- s0 << r5
531
- if r5
532
- r7 = _nt_line_to_eol
533
- s0 << r7
534
- if r7
535
- i8 = index
536
- s9, i9 = [], index
537
- loop do
538
- r10 = _nt_eol
539
- if r10
540
- s9 << r10
541
- else
542
- break
543
- end
544
- end
545
- if s9.empty?
546
- self.index = i9
547
- r9 = nil
548
- else
549
- r9 = SyntaxNode.new(input, i9...index, s9)
550
- end
551
- if r9
552
- r8 = r9
553
- else
554
- r11 = _nt_eof
555
- if r11
556
- r8 = r11
557
- else
558
- self.index = i8
559
- r8 = nil
560
- end
561
- end
562
- s0 << r8
563
- if r8
564
- r12 = _nt_steps
565
- s0 << r12
566
- end
567
- end
568
- end
569
- end
570
- end
571
- end
572
- end
573
- if s0.last
574
- r0 = (SyntaxNode).new(input, i0...index, s0)
575
- r0.extend(Scenario0)
576
- r0.extend(Scenario1)
577
- else
578
- self.index = i0
579
- r0 = nil
580
- end
581
-
582
- node_cache[:scenario][start_index] = r0
583
-
584
- return r0
585
- end
586
-
587
- module ScenarioOutline0
588
- def comment
589
- elements[0]
590
- end
591
-
592
- def tags
593
- elements[1]
594
- end
595
-
596
- def white
597
- elements[2]
598
- end
599
-
600
- def scenario_outline_keyword
601
- elements[3]
602
- end
603
-
604
- def name
605
- elements[5]
606
- end
607
-
608
- def white
609
- elements[6]
610
- end
611
-
612
- def steps
613
- elements[7]
614
- end
615
-
616
- def examples_sections
617
- elements[8]
618
- end
619
- end
620
-
621
- module ScenarioOutline1
622
- def build
623
- Ast::ScenarioOutline.new(
624
- comment.build,
625
- tags.build,
626
- scenario_outline_keyword.line,
627
- scenario_outline_keyword.text_value,
628
- name.text_value,
629
- steps.build,
630
- examples_sections.build
631
- )
632
- end
633
- end
634
-
635
- def _nt_scenario_outline
636
- start_index = index
637
- if node_cache[:scenario_outline].has_key?(index)
638
- cached = node_cache[:scenario_outline][index]
639
- @index = cached.interval.end if cached
640
- return cached
641
- end
642
-
643
- i0, s0 = index, []
644
- r1 = _nt_comment
645
- s0 << r1
646
- if r1
647
- r2 = _nt_tags
648
- s0 << r2
649
- if r2
650
- r3 = _nt_white
651
- s0 << r3
652
- if r3
653
- r4 = _nt_scenario_outline_keyword
654
- s0 << r4
655
- if r4
656
- s5, i5 = [], index
657
- loop do
658
- r6 = _nt_space
659
- if r6
660
- s5 << r6
661
- else
662
- break
663
- end
664
- end
665
- r5 = SyntaxNode.new(input, i5...index, s5)
666
- s0 << r5
667
- if r5
668
- r7 = _nt_line_to_eol
669
- s0 << r7
670
- if r7
671
- r8 = _nt_white
672
- s0 << r8
673
- if r8
674
- r9 = _nt_steps
675
- s0 << r9
676
- if r9
677
- r10 = _nt_examples_sections
678
- s0 << r10
679
- end
680
- end
681
- end
682
- end
683
- end
684
- end
685
- end
686
- end
687
- if s0.last
688
- r0 = (SyntaxNode).new(input, i0...index, s0)
689
- r0.extend(ScenarioOutline0)
690
- r0.extend(ScenarioOutline1)
691
- else
692
- self.index = i0
693
- r0 = nil
694
- end
695
-
696
- node_cache[:scenario_outline][start_index] = r0
697
-
698
- return r0
699
- end
700
-
701
- module Steps0
702
- def build
703
- elements.map{|e| e.build}
704
- end
705
- end
706
-
707
- def _nt_steps
708
- start_index = index
709
- if node_cache[:steps].has_key?(index)
710
- cached = node_cache[:steps][index]
711
- @index = cached.interval.end if cached
712
- return cached
713
- end
714
-
715
- s0, i0 = [], index
716
- loop do
717
- r1 = _nt_step
718
- if r1
719
- s0 << r1
720
- else
721
- break
722
- end
723
- end
724
- r0 = SyntaxNode.new(input, i0...index, s0)
725
- r0.extend(Steps0)
726
-
727
- node_cache[:steps][start_index] = r0
728
-
729
- return r0
730
- end
731
-
732
- module Step0
733
- def step_keyword
734
- elements[1]
735
- end
736
-
737
- def name
738
- elements[3]
739
- end
740
-
741
- def multi
742
- elements[5]
743
- end
744
- end
745
-
746
- module Step1
747
- def build
748
- if multi.respond_to?(:build)
749
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value, multi.build)
750
- else
751
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value)
752
- end
753
- end
754
- end
755
-
756
- def _nt_step
757
- start_index = index
758
- if node_cache[:step].has_key?(index)
759
- cached = node_cache[:step][index]
760
- @index = cached.interval.end if cached
761
- return cached
762
- end
763
-
764
- i0, s0 = index, []
765
- s1, i1 = [], index
766
- loop do
767
- r2 = _nt_space
768
- if r2
769
- s1 << r2
770
- else
771
- break
772
- end
773
- end
774
- r1 = SyntaxNode.new(input, i1...index, s1)
775
- s0 << r1
776
- if r1
777
- r3 = _nt_step_keyword
778
- s0 << r3
779
- if r3
780
- s4, i4 = [], index
781
- loop do
782
- r5 = _nt_space
783
- if r5
784
- s4 << r5
785
- else
786
- break
787
- end
788
- end
789
- r4 = SyntaxNode.new(input, i4...index, s4)
790
- s0 << r4
791
- if r4
792
- r6 = _nt_line_to_eol
793
- s0 << r6
794
- if r6
795
- i7 = index
796
- s8, i8 = [], index
797
- loop do
798
- r9 = _nt_eol
799
- if r9
800
- s8 << r9
801
- else
802
- break
803
- end
804
- end
805
- if s8.empty?
806
- self.index = i8
807
- r8 = nil
808
- else
809
- r8 = SyntaxNode.new(input, i8...index, s8)
810
- end
811
- if r8
812
- r7 = r8
813
- else
814
- r10 = _nt_eof
815
- if r10
816
- r7 = r10
817
- else
818
- self.index = i7
819
- r7 = nil
820
- end
821
- end
822
- s0 << r7
823
- if r7
824
- r12 = _nt_multiline_arg
825
- if r12
826
- r11 = r12
827
- else
828
- r11 = SyntaxNode.new(input, index...index)
829
- end
830
- s0 << r11
831
- end
832
- end
833
- end
834
- end
835
- end
836
- if s0.last
837
- r0 = (SyntaxNode).new(input, i0...index, s0)
838
- r0.extend(Step0)
839
- r0.extend(Step1)
840
- else
841
- self.index = i0
842
- r0 = nil
843
- end
844
-
845
- node_cache[:step][start_index] = r0
846
-
847
- return r0
848
- end
849
-
850
- module ExamplesSections0
851
- def build
852
- elements.map{|e| e.build}
853
- end
854
- end
855
-
856
- def _nt_examples_sections
857
- start_index = index
858
- if node_cache[:examples_sections].has_key?(index)
859
- cached = node_cache[:examples_sections][index]
860
- @index = cached.interval.end if cached
861
- return cached
862
- end
863
-
864
- s0, i0 = [], index
865
- loop do
866
- r1 = _nt_examples
867
- if r1
868
- s0 << r1
869
- else
870
- break
871
- end
872
- end
873
- if s0.empty?
874
- self.index = i0
875
- r0 = nil
876
- else
877
- r0 = SyntaxNode.new(input, i0...index, s0)
878
- r0.extend(ExamplesSections0)
879
- end
880
-
881
- node_cache[:examples_sections][start_index] = r0
882
-
883
- return r0
884
- end
885
-
886
- module Examples0
887
- def examples_keyword
888
- elements[1]
889
- end
890
-
891
- def white
892
- elements[2]
893
- end
894
-
895
- def table
896
- elements[3]
897
- end
898
- end
899
-
900
- module Examples1
901
- def build
902
- [examples_keyword.line, examples_keyword.text_value, "", table.raw]
903
- end
904
- end
905
-
906
- def _nt_examples
907
- start_index = index
908
- if node_cache[:examples].has_key?(index)
909
- cached = node_cache[:examples][index]
910
- @index = cached.interval.end if cached
911
- return cached
912
- end
913
-
914
- i0, s0 = index, []
915
- s1, i1 = [], index
916
- loop do
917
- r2 = _nt_space
918
- if r2
919
- s1 << r2
920
- else
921
- break
922
- end
923
- end
924
- r1 = SyntaxNode.new(input, i1...index, s1)
925
- s0 << r1
926
- if r1
927
- r3 = _nt_examples_keyword
928
- s0 << r3
929
- if r3
930
- r4 = _nt_white
931
- s0 << r4
932
- if r4
933
- r5 = _nt_table
934
- s0 << r5
935
- end
936
- end
937
- end
938
- if s0.last
939
- r0 = (SyntaxNode).new(input, i0...index, s0)
940
- r0.extend(Examples0)
941
- r0.extend(Examples1)
942
- else
943
- self.index = i0
944
- r0 = nil
945
- end
946
-
947
- node_cache[:examples][start_index] = r0
948
-
949
- return r0
950
- end
951
-
952
- def _nt_multiline_arg
953
- start_index = index
954
- if node_cache[:multiline_arg].has_key?(index)
955
- cached = node_cache[:multiline_arg][index]
956
- @index = cached.interval.end if cached
957
- return cached
958
- end
959
-
960
- i0 = index
961
- r1 = _nt_table
962
- if r1
963
- r0 = r1
964
- else
965
- r2 = _nt_py_string
966
- if r2
967
- r0 = r2
968
- else
969
- self.index = i0
970
- r0 = nil
971
- end
972
- end
973
-
974
- node_cache[:multiline_arg][start_index] = r0
975
-
976
- return r0
977
- end
978
-
979
- module LineToEol0
980
- end
981
-
982
- def _nt_line_to_eol
983
- start_index = index
984
- if node_cache[:line_to_eol].has_key?(index)
985
- cached = node_cache[:line_to_eol][index]
986
- @index = cached.interval.end if cached
987
- return cached
988
- end
989
-
990
- s0, i0 = [], index
991
- loop do
992
- i1, s1 = index, []
993
- i2 = index
994
- r3 = _nt_eol
995
- if r3
996
- r2 = nil
997
- else
998
- self.index = i2
999
- r2 = SyntaxNode.new(input, index...index)
1000
- end
1001
- s1 << r2
1002
- if r2
1003
- if index < input_length
1004
- r4 = (SyntaxNode).new(input, index...(index + 1))
1005
- @index += 1
1006
- else
1007
- terminal_parse_failure("any character")
1008
- r4 = nil
1009
- end
1010
- s1 << r4
1011
- end
1012
- if s1.last
1013
- r1 = (SyntaxNode).new(input, i1...index, s1)
1014
- r1.extend(LineToEol0)
1015
- else
1016
- self.index = i1
1017
- r1 = nil
1018
- end
1019
- if r1
1020
- s0 << r1
1021
- else
1022
- break
1023
- end
1024
- end
1025
- if s0.empty?
1026
- self.index = i0
1027
- r0 = nil
1028
- else
1029
- r0 = SyntaxNode.new(input, i0...index, s0)
1030
- end
1031
-
1032
- node_cache[:line_to_eol][start_index] = r0
1033
-
1034
- return r0
1035
- end
1036
-
1037
- module PyString0
1038
- end
1039
-
1040
- module PyString1
1041
- def open_py_string
1042
- elements[0]
1043
- end
1044
-
1045
- def s
1046
- elements[1]
1047
- end
1048
-
1049
- def close_py_string
1050
- elements[2]
1051
- end
1052
- end
1053
-
1054
- module PyString2
1055
- def build
1056
- Ast::PyString.new(open_py_string.line, close_py_string.line, s.text_value, open_py_string.indentation)
1057
- end
1058
- end
1059
-
1060
- def _nt_py_string
1061
- start_index = index
1062
- if node_cache[:py_string].has_key?(index)
1063
- cached = node_cache[:py_string][index]
1064
- @index = cached.interval.end if cached
1065
- return cached
1066
- end
1067
-
1068
- i0, s0 = index, []
1069
- r1 = _nt_open_py_string
1070
- s0 << r1
1071
- if r1
1072
- s2, i2 = [], index
1073
- loop do
1074
- i3, s3 = index, []
1075
- i4 = index
1076
- r5 = _nt_close_py_string
1077
- if r5
1078
- r4 = nil
1079
- else
1080
- self.index = i4
1081
- r4 = SyntaxNode.new(input, index...index)
1082
- end
1083
- s3 << r4
1084
- if r4
1085
- if index < input_length
1086
- r6 = (SyntaxNode).new(input, index...(index + 1))
1087
- @index += 1
1088
- else
1089
- terminal_parse_failure("any character")
1090
- r6 = nil
1091
- end
1092
- s3 << r6
1093
- end
1094
- if s3.last
1095
- r3 = (SyntaxNode).new(input, i3...index, s3)
1096
- r3.extend(PyString0)
1097
- else
1098
- self.index = i3
1099
- r3 = nil
1100
- end
1101
- if r3
1102
- s2 << r3
1103
- else
1104
- break
1105
- end
1106
- end
1107
- r2 = SyntaxNode.new(input, i2...index, s2)
1108
- s0 << r2
1109
- if r2
1110
- r7 = _nt_close_py_string
1111
- s0 << r7
1112
- end
1113
- end
1114
- if s0.last
1115
- r0 = (SyntaxNode).new(input, i0...index, s0)
1116
- r0.extend(PyString1)
1117
- r0.extend(PyString2)
1118
- else
1119
- self.index = i0
1120
- r0 = nil
1121
- end
1122
-
1123
- node_cache[:py_string][start_index] = r0
1124
-
1125
- return r0
1126
- end
1127
-
1128
- module OpenPyString0
1129
- def white
1130
- elements[0]
1131
- end
1132
-
1133
- def eol
1134
- elements[3]
1135
- end
1136
- end
1137
-
1138
- module OpenPyString1
1139
- def indentation
1140
- white.text_value.length
1141
- end
1142
-
1143
- def line
1144
- white.line
1145
- end
1146
- end
1147
-
1148
- def _nt_open_py_string
1149
- start_index = index
1150
- if node_cache[:open_py_string].has_key?(index)
1151
- cached = node_cache[:open_py_string][index]
1152
- @index = cached.interval.end if cached
1153
- return cached
1154
- end
1155
-
1156
- i0, s0 = index, []
1157
- r1 = _nt_white
1158
- s0 << r1
1159
- if r1
1160
- if input.index('"""', index) == index
1161
- r2 = (SyntaxNode).new(input, index...(index + 3))
1162
- @index += 3
1163
- else
1164
- terminal_parse_failure('"""')
1165
- r2 = nil
1166
- end
1167
- s0 << r2
1168
- if r2
1169
- s3, i3 = [], index
1170
- loop do
1171
- r4 = _nt_space
1172
- if r4
1173
- s3 << r4
1174
- else
1175
- break
1176
- end
1177
- end
1178
- r3 = SyntaxNode.new(input, i3...index, s3)
1179
- s0 << r3
1180
- if r3
1181
- r5 = _nt_eol
1182
- s0 << r5
1183
- end
1184
- end
1185
- end
1186
- if s0.last
1187
- r0 = (SyntaxNode).new(input, i0...index, s0)
1188
- r0.extend(OpenPyString0)
1189
- r0.extend(OpenPyString1)
1190
- else
1191
- self.index = i0
1192
- r0 = nil
1193
- end
1194
-
1195
- node_cache[:open_py_string][start_index] = r0
1196
-
1197
- return r0
1198
- end
1199
-
1200
- module ClosePyString0
1201
- def eol
1202
- elements[0]
1203
- end
1204
-
1205
- def quotes
1206
- elements[2]
1207
- end
1208
-
1209
- def white
1210
- elements[3]
1211
- end
1212
- end
1213
-
1214
- module ClosePyString1
1215
- def line
1216
- quotes.line
1217
- end
1218
- end
1219
-
1220
- def _nt_close_py_string
1221
- start_index = index
1222
- if node_cache[:close_py_string].has_key?(index)
1223
- cached = node_cache[:close_py_string][index]
1224
- @index = cached.interval.end if cached
1225
- return cached
1226
- end
1227
-
1228
- i0, s0 = index, []
1229
- r1 = _nt_eol
1230
- s0 << r1
1231
- if r1
1232
- s2, i2 = [], index
1233
- loop do
1234
- r3 = _nt_space
1235
- if r3
1236
- s2 << r3
1237
- else
1238
- break
1239
- end
1240
- end
1241
- r2 = SyntaxNode.new(input, i2...index, s2)
1242
- s0 << r2
1243
- if r2
1244
- if input.index('"""', index) == index
1245
- r4 = (SyntaxNode).new(input, index...(index + 3))
1246
- @index += 3
1247
- else
1248
- terminal_parse_failure('"""')
1249
- r4 = nil
1250
- end
1251
- s0 << r4
1252
- if r4
1253
- r5 = _nt_white
1254
- s0 << r5
1255
- end
1256
- end
1257
- end
1258
- if s0.last
1259
- r0 = (SyntaxNode).new(input, i0...index, s0)
1260
- r0.extend(ClosePyString0)
1261
- r0.extend(ClosePyString1)
1262
- else
1263
- self.index = i0
1264
- r0 = nil
1265
- end
1266
-
1267
- node_cache[:close_py_string][start_index] = r0
1268
-
1269
- return r0
1270
- end
1271
-
1272
- def _nt_white
1273
- start_index = index
1274
- if node_cache[:white].has_key?(index)
1275
- cached = node_cache[:white][index]
1276
- @index = cached.interval.end if cached
1277
- return cached
1278
- end
1279
-
1280
- s0, i0 = [], index
1281
- loop do
1282
- i1 = index
1283
- r2 = _nt_space
1284
- if r2
1285
- r1 = r2
1286
- else
1287
- r3 = _nt_eol
1288
- if r3
1289
- r1 = r3
1290
- else
1291
- self.index = i1
1292
- r1 = nil
1293
- end
1294
- end
1295
- if r1
1296
- s0 << r1
1297
- else
1298
- break
1299
- end
1300
- end
1301
- r0 = SyntaxNode.new(input, i0...index, s0)
1302
-
1303
- node_cache[:white][start_index] = r0
1304
-
1305
- return r0
1306
- end
1307
-
1308
- end
1309
-
1310
- class FeatureParser < Treetop::Runtime::CompiledParser
1311
- include Feature
1312
- end
1313
-
1314
- end
1315
- end