Method: RDoc::Markdown::Literals#show_error

Defined in:
lib/rdoc/markdown/literals.rb

#show_error(io = STDOUT) ⇒ Object



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/rdoc/markdown/literals.rb', line 174

def show_error(io=STDOUT)
  error_pos = @failing_rule_offset
  p = current_pos_info(error_pos)

  io.puts "On line #{p.lno}, column #{p.col}:"

  if @failed_rule.kind_of? Symbol
    info = self.class::Rules[@failed_rule]
    io.puts "Failed to match '#{info.rendered}' (rule '#{info.name}')"
  else
    io.puts "Failed to match rule '#{@failed_rule}'"
  end

  io.puts "Got: #{p.char.inspect}"
  io.puts "=> #{p.line}"
  io.print(" " * (p.col + 2))
  io.puts "^"
end