123456789_123456789_123456789_123456789_123456789_

Exception: Parser::SyntaxError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, StandardError
Instance Chain:
self, StandardError
Inherits: StandardError
  • Object
Defined in: lib/rubocop/ast/vendor/parser/syntax_error.rb

Overview

SyntaxError is raised whenever parser detects a syntax error, similar to the standard SyntaxError class.

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(diagnostic) ⇒ SyntaxError

[ GitHub ]

  
# File 'lib/rubocop/ast/vendor/parser/syntax_error.rb', line 16

def initialize(diagnostic)
  @diagnostic = diagnostic
  super(diagnostic.message)
end

Instance Attribute Details

#diagnostic ⇒ Parser::Diagnostic (readonly)

[ GitHub ]

  
# File 'lib/rubocop/ast/vendor/parser/syntax_error.rb', line 13

class SyntaxError < StandardError
  attr_reader :diagnostic

  def initialize(diagnostic)
    @diagnostic = diagnostic
    super(diagnostic.message)
  end
end