class Prism::ParseError - Documentation for Ruby 4.0
Description: class Prism::ParseError: This represents an error that was encountered during parsing.
Keywords: ruby,class,Prism::ParseError

🔍

No recent searches

# class Prism::ParseError

This represents an error that was encountered during parsing.

### Attributes

level [R]

The level of this error.

location [R]

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

message [R]

The message associated with this error.

type [R]

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.

### Public Class Methods

new (type, message, location, level)
Source

    # File lib/prism/parse_result.rb, line 612
    def initialize(type, message, location, level)
      @type = type
      @message = message
      @location = location
      @level = level
    end

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

### Public Instance Methods

deconstruct_keys (keys)
Source

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

Implement the hash pattern matching interface for `ParseError`.

inspect ()
Source

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

Returns a string representation of this error.