Exception: Voodoo::Parser::Error

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

Overview

Base class for errors reported from the parser. This provides methods to get the name of the input being processed, as well as the start_line, start_column, and text of the code that triggered the error.

Direct Known Subclasses

MultipleErrors, ParseError, ParserInternalError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, input_name, start_line, start_column, text) ⇒ Error

Returns a new instance of Error.



45
46
47
48
49
50
51
# File 'lib/voodoo/parser.rb', line 45

def initialize message, input_name, start_line, start_column, text
  super message
  @input_name = input_name
  @start_line = start_line
  @start_column = start_column
  @text = text
end

Instance Attribute Details

#input_nameObject (readonly)

Returns the value of attribute input_name.



53
54
55
# File 'lib/voodoo/parser.rb', line 53

def input_name
  @input_name
end

#start_columnObject (readonly)

Returns the value of attribute start_column.



53
54
55
# File 'lib/voodoo/parser.rb', line 53

def start_column
  @start_column
end

#start_lineObject (readonly)

Returns the value of attribute start_line.



53
54
55
# File 'lib/voodoo/parser.rb', line 53

def start_line
  @start_line
end

#textObject (readonly)

Returns the value of attribute text.



53
54
55
# File 'lib/voodoo/parser.rb', line 53

def text
  @text
end