Class: Ibex::Frontend::Location

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

Overview

A source coordinate retained by frontend and IR objects.

Instance Attribute Summary collapse

Class Method 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

Class Method Details

.new(file:, line:, column:) ⇒ instance .new(arg0) ⇒ instance

Overloads:

  • .new(file:, line:, column:) ⇒ instance

    Parameters:

    • file: (String)
    • line: (Integer)
    • column: (Integer)

    Returns:

    • (instance)
  • .new(arg0) ⇒ instance

    Parameters:

    • arg0 ({ ?file: String, ?line: Integer, ?column: Integer })

    Returns:

    • (instance)


13
14
# File 'sig/ibex/frontend/source_cursor.rbs', line 13

def self.new: (?file: String, ?line: Integer, ?column: Integer) -> instance
| ({ ?file: String, ?line: Integer, ?column: Integer }) -> instance

Instance Method Details

#to_hIR::location

RBS:

  • () -> IR::location

Returns:

  • (IR::location)


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

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

#to_sString

RBS:

  • () -> String

Returns:

  • (String)


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

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