123456789_123456789_123456789_123456789_123456789_

Exception: RBS::ParsingError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, BaseError, StandardError
Instance Chain:
self, DetailedMessageable, BaseError, StandardError
Inherits: RBS::BaseError
Defined in: lib/rbs/errors.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(location, error_message, token_type) ⇒ ParsingError

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 58

def initialize(location, error_message, token_type)
  @location = location
  @error_message = error_message
  @token_type = token_type

  super "#{Location.to_string location}: Syntax error: #{error_message}, token=`#{location.source}` (#{token_type})"
end

Instance Attribute Details

#error_message (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 55

attr_reader :error_message

#location (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 54

attr_reader :location

#token_type (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 56

attr_reader :token_type

Instance Method Details

#error_value

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 66

def error_value
  RBS.print_warning {
    "#{self.class.name}#error_value is deprecated and will be deleted in RBS 2.0. Consider using `location.source` instead."
  }
  location.source
end

#token_str

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 73

def token_str
  RBS.print_warning {
    "#{self.class.name}#token_str is deprecated and will be deleted in RBS 2.0. Consider using `token_type` instead."
  }
  token_type
end