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

- (SyntaxError) initialize(diagnostic)

Returns a new instance of SyntaxError



14
15
16
17
# File 'lib/parser/syntax_error.rb', line 14

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

Instance Attribute Details

- (Parser::Diagnostic) diagnostic (readonly)

Returns:



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

class SyntaxError < StandardError
  attr_reader :diagnostic

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