lib/cucumber/parser.rb in cucumber-0.2.2 vs lib/cucumber/parser.rb in cucumber-0.2.3
- old
+ new
@@ -11,16 +11,10 @@
#
# The AST is built by the various <tt>#build</tt> methods in the parse tree.
#
# The AST classes are defined in the Cucumber::Ast module.
module Parser
- translator = Module.new do
- def keywordz(key)
- 'Scenario'
- end
- end
-
def self.load_parser(keywords)
Loader.new(keywords)
end
class Loader
@@ -32,10 +26,11 @@
grammar = erb.result(binding)
Treetop.load_from_string(grammar)
require 'cucumber/parser/feature'
end
- def keywords(key)
+ def keywords(key, raw=false)
+ return @keywords[key] if raw
values = @keywords[key].split('|')
values.map{|value| "'#{value}'"}.join(" / ")
end
end
end
\ No newline at end of file