Exception: RBS::ParsingError

Inherits:
BaseError
  • Object
show all
Includes:
DetailedMessageable
Defined in:
sig/errors.rbs,
lib/rbs/errors.rb

Overview

Error class for errors raised during parsing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DetailedMessageable

#detailed_message

Constructor Details

#initialize(location, error_message, token_type) ⇒ ParsingError

Returns a new instance of ParsingError.

Parameters:

  • (Location[untyped, untyped])
  • error_message (String)
  • token_type (String)


58
59
60
61
62
63
64
# 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_messageString (readonly)

Returns the value of attribute error_message.

Returns:

  • (String)


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

def error_message
  @error_message
end

#locationLocation[untyped, untyped] (readonly)

Returns the value of attribute location.

Returns:



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

def location
  @location
end

#token_typeString (readonly)

Returns the value of attribute token_type.

Returns:

  • (String)


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

def token_type
  @token_type
end

Instance Method Details

#error_valueString

Returns:

  • (String)


38
# File 'sig/errors.rbs', line 38

def error_value: () -> String

#token_strString

Returns:

  • (String)


40
# File 'sig/errors.rbs', line 40

def token_str: () -> String