Exception: Brainfucktt::ParserError
- Defined in:
- lib/brainfucktt/errors.rb
Overview
Raised when the code being parsed has a syntax error.
Instance Method Summary collapse
- #column ⇒ String
-
#initialize(language_parser) ⇒ ParserError
constructor
A new instance of ParserError.
- #line ⇒ String
- #reason ⇒ String
- #to_s ⇒ String
Constructor Details
#initialize(language_parser) ⇒ ParserError
Returns a new instance of ParserError.
44 45 46 47 48 |
# File 'lib/brainfucktt/errors.rb', line 44 def initialize(language_parser) raise TypeError unless language_parser.instance_of?(Brainfucktt::LanguageParser) @language_parser = language_parser end |
Instance Method Details
#column ⇒ String
66 67 68 |
# File 'lib/brainfucktt/errors.rb', line 66 def column @language_parser.failure_column end |
#line ⇒ String
61 62 63 |
# File 'lib/brainfucktt/errors.rb', line 61 def line @language_parser.failure_line end |
#reason ⇒ String
56 57 58 |
# File 'lib/brainfucktt/errors.rb', line 56 def reason @language_parser.failure_reason end |
#to_s ⇒ String
51 52 53 |
# File 'lib/brainfucktt/errors.rb', line 51 def to_s "Error at column #{column}, line #{line} - '#{reason}'" end |