Class: Treetop::Runtime::CompiledParser

Inherits:
Object
  • Object
show all
Defined in:
lib/less.rb

Direct Known Subclasses

LessParser

Instance Method Summary collapse

Instance Method Details

#failure_messageObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/less.rb', line 36

def failure_message
  return nil unless (tf = terminal_failures) && tf.size > 0
  "on line #{failure_line}: expected " + (
    tf.size == 1 ? 
      tf[0].expected_string : 
      "one of #{tf.map {|f| f.expected_string }.uniq * ' '}"
  ) +
  " got `#{input[failure_index]}`" +
  " after:\n\n#{input[index...failure_index]}\n"
end