Skip to Content Skip to Search

This represents an error that was encountered during parsing.

Methods
D
I
N

Attributes

[R] location

A Location object representing the location of this error in the source.

[R] message

The message associated with this error.

Class Public methods

new(message, location)

Create a new error object with the given message and location.

# File ruby/lib/prism/parse_result.rb, line 316
def initialize(message, location)
  @message = message
  @location = location
end

Instance Public methods

deconstruct_keys(keys)

Implement the hash pattern matching interface for ParseError.

# File ruby/lib/prism/parse_result.rb, line 322
def deconstruct_keys(keys)
  { message: message, location: location }
end

inspect()

Returns a string representation of this error.

# File ruby/lib/prism/parse_result.rb, line 327
def inspect
  "#<Prism::ParseError @message=#{@message.inspect} @location=#{@location.inspect}>"
end