class SyntaxTree::Location

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/syntax_tree/node.rbs

class SyntaxTree::Location
  def self.fixed: (line: Integer, char: Integer, column: Integer) -> untyped
  def self.token: (line: Integer, char: Integer, column: Integer, size: Integer) -> untyped
  def initialize: (start_line: Integer, start_char: Integer, start_column: Integer, end_line: Integer, end_char: Integer, end_column: Integer) -> void
  def to: (SyntaxTree::Location other) -> untyped
end

Represents the location of a node in the tree from the source code.

def self.default

constructor.
location of a node, but need to create a Location instance to pass to a
A convenience method that is typically used when you don't care about the
def self.default
  new(
    start_line: 1,
    start_char: 0,
    start_column: 0,
    end_line: 1,
    end_char: 0,
    end_column: 0
  )
end

def self.fixed(line:, char:, column:)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.fixed: (line: Integer, char: Integer, column: Integer) -> untyped

This signature was generated using 74 samples from 1 application.

def self.fixed(line:, char:, column:)
  new(
    start_line: line,
    start_char: char,
    start_column: column,
    end_line: line,
    end_char: char,
    end_column: column
  )
end

def self.token(line:, char:, column:, size:)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.token: (line: Integer, char: Integer, column: Integer, size: Integer) -> untyped

This signature was generated using 371 samples from 1 application.

def self.token(line:, char:, column:, size:)
  new(
    start_line: line,
    start_char: char,
    start_column: column,
    end_line: line,
    end_char: char + size,
    end_column: column + size
  )
end

def ==(other)

def ==(other)
  other.is_a?(Location) && start_line == other.start_line &&
    start_char == other.start_char && end_line == other.end_line &&
    end_char == other.end_char
end

def deconstruct

def deconstruct
  [start_line, start_char, start_column, end_line, end_char, end_column]
end

def deconstruct_keys(_keys)

def deconstruct_keys(_keys)
  {
    start_line: start_line,
    start_char: start_char,
    start_column: start_column,
    end_line: end_line,
    end_char: end_char,
    end_column: end_column
  }
end

def initialize(

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (start_line: Integer, start_char: Integer, start_column: Integer, end_line: Integer, end_char: Integer, end_column: Integer) -> void

This signature was generated using 613 samples from 1 application.

def initialize(
  start_line:,
  start_char:,
  start_column:,
  end_line:,
  end_char:,
  end_column:
)
  @start_line = start_line
  @start_char = start_char
  @start_column = start_column
  @end_line = end_line
  @end_char = end_char
  @end_column = end_column
end

def lines

def lines
  start_line..end_line
end

def to(other)

Experimental RBS support (using type sampling data from the type_fusion project).

def to: (SyntaxTree::Location other) -> untyped

This signature was generated using 175 samples from 1 application.

def to(other)
  Location.new(
    start_line: start_line,
    start_char: start_char,
    start_column: start_column,
    end_line: [end_line, other.end_line].max,
    end_char: other.end_char,
    end_column: other.end_column
  )
end