Exception: RBS::ParsingError
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#token_type ⇒ Object
readonly
Returns the value of attribute token_type.
Instance Method Summary collapse
- #error_value ⇒ Object
-
#initialize(location, error_message, token_type) ⇒ ParsingError
constructor
A new instance of ParsingError.
- #token_str ⇒ Object
Constructor Details
#initialize(location, error_message, token_type) ⇒ ParsingError
Returns a new instance of ParsingError.
28 29 30 31 32 33 34 |
# File 'lib/rbs/errors.rb', line 28 def initialize(location, , token_type) @location = location @error_message = @token_type = token_type super "#{Location.to_string location}: Syntax error: #{}, token=`#{location.source}` (#{token_type})" end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
25 26 27 |
# File 'lib/rbs/errors.rb', line 25 def @error_message end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
24 25 26 |
# File 'lib/rbs/errors.rb', line 24 def location @location end |
#token_type ⇒ Object (readonly)
Returns the value of attribute token_type.
26 27 28 |
# File 'lib/rbs/errors.rb', line 26 def token_type @token_type end |
Instance Method Details
#error_value ⇒ Object
36 37 38 39 40 41 |
# File 'lib/rbs/errors.rb', line 36 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 ⇒ Object
43 44 45 46 47 48 |
# File 'lib/rbs/errors.rb', line 43 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 |