Exception: Steep::AnnotationParser::SyntaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/steep/annotation_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, location:, exn: nil, message: nil) ⇒ SyntaxError

Returns a new instance of SyntaxError.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/steep/annotation_parser.rb', line 23

def initialize(source:, location:, exn: nil, message: nil)
  @source = source
  @location = location

  if exn
    message =
      case exn
      when RBS::ParsingError
        Diagnostic::Signature::SyntaxError.parser_syntax_error_message(exn)
      else
        exn.message
      end
  end

  super message
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



21
22
23
# File 'lib/steep/annotation_parser.rb', line 21

def location
  @location
end

#sourceObject (readonly)

Returns the value of attribute source.



20
21
22
# File 'lib/steep/annotation_parser.rb', line 20

def source
  @source
end