Class: Prism::ParseError
| Relationships & Source Files | |
| Inherits: | Object | 
| Defined in: | lib/prism/parse_result.rb | 
Overview
This represents an error that was encountered during parsing.
Class Method Summary
- 
    
      .new(message, location)  ⇒ 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(message, location)  ⇒ ParseError 
  
Create a new error object with the given message and location.
Instance Attribute Details
#location (readonly)
A Location object representing the location of this error in the source.
# File 'lib/prism/parse_result.rb', line 313
attr_reader :location
#message (readonly)
The message associated with this error.
# File 'lib/prism/parse_result.rb', line 310
attr_reader :
Instance Method Details
#deconstruct_keys(keys)
Implement the hash pattern matching interface for ParseError.
# File 'lib/prism/parse_result.rb', line 322
def deconstruct_keys(keys) { message: , location: location } end
#inspect
Returns a string representation of this error.
# File 'lib/prism/parse_result.rb', line 327
def inspect "#<Prism::ParseError @message=#{@message.inspect} @location=#{@location.inspect}>" end