Exception: Parser::SyntaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/parser/syntax_error.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(diagnostic) ⇒ SyntaxError

Returns a new instance of SyntaxError.


16
17
18
19
# File 'lib/parser/syntax_error.rb', line 16

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

Instance Attribute Details

#diagnosticParser::Diagnostic (readonly)

Returns:


13
14
15
16
17
18
19
20
# File 'lib/parser/syntax_error.rb', line 13

class SyntaxError < StandardError
  attr_reader :diagnostic

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