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)
Internal use only
Implement the hash pattern matching interface for
ParseError. -
#inspect
Internal use only
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 808
attr_reader :level #: Symbol
#location (readonly)
A Location object representing the location of this error in the source.
# File 'lib/prism/parse_result.rb', line 805
attr_reader :location #: Location
#message (readonly)
The message associated with this error.
# File 'lib/prism/parse_result.rb', line 802
attr_reader : #: String
#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 799
attr_reader :type #: Symbol
Instance Method Details
#deconstruct_keys(keys)
This method is for internal use only.
Implement the hash pattern matching interface for ParseError.
#inspect
This method is for internal use only.
Returns a string representation of this error.
# File 'lib/prism/parse_result.rb', line 830
def inspect # :nodoc: "#<Prism::ParseError @type=#{@type.inspect} @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>" end