Exception: Johnson::Parser::SyntaxError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, file_name, line_number) ⇒ SyntaxError

Returns a new instance of SyntaxError.



5
6
7
8
9
10
# File 'lib/johnson/parser/syntax_error.rb', line 5

def initialize(message, file_name, line_number)
  super("#{message} in (#{file_name || "nil"}): #{line_number}")
  @message      = message
  @file_name    = file_name
  @line_number  = line_number
end

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



4
5
6
# File 'lib/johnson/parser/syntax_error.rb', line 4

def file_name
  @file_name
end

#line_numberObject

Returns the value of attribute line_number.



4
5
6
# File 'lib/johnson/parser/syntax_error.rb', line 4

def line_number
  @line_number
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/johnson/parser/syntax_error.rb', line 4

def message
  @message
end