Exception: Grammar::PreProcessorError

Inherits:
ParserError
  • Object
show all
Defined in:
lib/emerald/grammar.rb

Overview

When the parser fails on a line added only in preprocessing

Constant Summary

Constants inherited from ParserError

Grammar::ParserError::LINES_AFTER, Grammar::ParserError::LINES_BEFORE

Instance Method Summary collapse

Methods inherited from ParserError

#initialize, #message

Constructor Details

This class inherits a constructor from Grammar::ParserError

Instance Method Details

#sayObject



55
56
57
58
59
60
61
62
# File 'lib/emerald/grammar.rb', line 55

def say
  messages = []
  messages << "Error parsing in pre-processed Emerald. This is likely a bug."
  messages << @reason
  messages.concat(@source.lines.with_index { |line, i| puts "#{i + 1} #{line}" })

  messages.join("\n")
end