Class: Steep::Diagnostic::Signature::SyntaxError
- Defined in:
- lib/steep/diagnostic/signature.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(exception, location:) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
Methods inherited from Base
#detail_lines, #diagnostic_code, #path
Methods included from Helper
Constructor Details
#initialize(exception, location:) ⇒ SyntaxError
Returns a new instance of SyntaxError.
35 36 37 38 |
# File 'lib/steep/diagnostic/signature.rb', line 35 def initialize(exception, location:) super(location: location) @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
33 34 35 |
# File 'lib/steep/diagnostic/signature.rb', line 33 def exception @exception end |
Class Method Details
.parser_syntax_error_message(exception) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/steep/diagnostic/signature.rb', line 40 def self.(exception) string = exception.location.source.to_s unless string.empty? string = " (#{string})" end "Syntax error caused by token `#{exception.token_type}`#{string}" end |
Instance Method Details
#header_line ⇒ Object
49 50 51 |
# File 'lib/steep/diagnostic/signature.rb', line 49 def header_line exception. end |