Class: Prism::ParseError
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/prism/parse_result.rb, prism/extension.c |
Overview
This represents an error that was encountered during parsing.
Class Method Summary
-
.new(type, message, location, level) ⇒ ParseError
constructor
Create a new error object with the given message and location.
Instance Attribute Summary
Instance Method Summary
-
#deconstruct_keys(keys)
Implement the hash pattern matching interface for
ParseError
. -
#inspect
Returns a string representation of this error.
Constructor Details
.new(type, message, location, level) ⇒ ParseError
Create a new error object with the given message and location.
Instance Attribute Details
#level (readonly)
The level of this error.
# File 'lib/prism/parse_result.rb', line 604
attr_reader :level
#location (readonly)
A Location object representing the location of this error in the source.
# File 'lib/prism/parse_result.rb', line 601
attr_reader :location
#message (readonly)
The message associated with this error.
# File 'lib/prism/parse_result.rb', line 598
attr_reader :
#type (readonly)
The type of error. This is an internal symbol that is used for communicating with translation layers. It is not meant to be public API.
# File 'lib/prism/parse_result.rb', line 595
attr_reader :type
Instance Method Details
#deconstruct_keys(keys)
Implement the hash pattern matching interface for ParseError
.
#inspect
Returns a string representation of this error.
# File 'lib/prism/parse_result.rb', line 620
def inspect "#<Prism::ParseError @type=#{@type.inspect} @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>" end