Exception: Trope::Parser::Error

Inherits:
Error
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/trope/parser/error.rb

Overview

The base class for Trope::Parser errors.

Instance Method Summary collapse

Constructor Details

#initialize(language_parser) ⇒ Error

Returns a new instance of Error.

Parameters:

  • language_parser (Trope::LanguageParser)

Raises:

  • (TypeError)


17
18
19
20
21
# File 'lib/trope/parser/error.rb', line 17

def initialize(language_parser)
  raise TypeError unless language_parser.instance_of?(Trope::LanguageParser)
  
  @language_parser = language_parser
end

Instance Method Details

#to_sString

Returns:

  • (String)


24
25
26
# File 'lib/trope/parser/error.rb', line 24

def to_s
  reason || "Invalid - column #{column}, line #{line}"
end