Class: Habaki::Error

Inherits:
Node
  • Object
show all
Defined in:
lib/habaki/error.rb

Overview

syntax error

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#string, #to_s

Constructor Details

#initializeError

Returns a new instance of Error.



21
22
23
# File 'lib/habaki/error.rb', line 21

def initialize
  @position = SourcePosition.new
end

Instance Attribute Details

#messageString

Returns:



19
20
21
# File 'lib/habaki/error.rb', line 19

def message
  @message
end

#positionSourcePosition

Returns:



17
18
19
# File 'lib/habaki/error.rb', line 17

def position
  @position
end

Instance Method Details

#columnInteger

Returns:

  • (Integer)


31
32
33
# File 'lib/habaki/error.rb', line 31

def column
  @position.column
end

#lineInteger

Returns:

  • (Integer)


26
27
28
# File 'lib/habaki/error.rb', line 26

def line
  @position.line
end

#read_from_katana(err) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:



38
39
40
41
# File 'lib/habaki/error.rb', line 38

def read_from_katana(err)
  @position = SourcePosition.new(err.first_line, err.first_column)
  @message = err.message
end