Exception: Cucumber::TreetopParser::Feature::SyntaxError
- Defined in:
- lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_parser.rb
Instance Method Summary collapse
-
#initialize(file, parser) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #message ⇒ Object
Constructor Details
#initialize(file, parser) ⇒ SyntaxError
Returns a new instance of SyntaxError.
5 6 7 8 9 10 11 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_parser.rb', line 5 def initialize(file, parser) tf = parser.terminal_failures expected = tf.size == 1 ? tf[0].expected_string.inspect : "one of #{tf.map{|f| f.expected_string.inspect}.uniq*', '}" after = parser.input[parser.index...parser.failure_index] found = parser.input[parser.failure_index..parser.failure_index] @message = "#{file}:#{parser.failure_line}:#{parser.failure_column}: Parse error, expected #{expected}. After #{after.inspect}. Found: #{found.inspect}" end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_parser.rb', line 13 def @message end |