Class: Ibex::Frontend::Location

Inherits:
Struct
  • Object
show all
Defined in:
lib/ibex/frontend/source_cursor.rb,
lib/ibex/frontend/source_cursor.rb

Overview

A source coordinate retained by frontend and IR objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnObject

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



6
7
8
# File 'lib/ibex/frontend/source_cursor.rb', line 6

def column
  @column
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



6
7
8
# File 'lib/ibex/frontend/source_cursor.rb', line 6

def file
  @file
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



6
7
8
# File 'lib/ibex/frontend/source_cursor.rb', line 6

def line
  @line
end

Instance Method Details

#to_hObject



15
16
17
# File 'lib/ibex/frontend/source_cursor.rb', line 15

def to_h
  { file: file, line: line, column: column }
end

#to_sObject



20
21
22
# File 'lib/ibex/frontend/source_cursor.rb', line 20

def to_s
  "#{file}:#{line}:#{column}"
end