struct Cradare2::Lines::SourceLocation

Overview

Represents a source location in a Crystal codebase.

Defined in:

cradare2/lines/source_location.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file : String, line : Int32, column : Int32 = 0, source_code : String | Nil = nil) #

[View source]

Instance Method Detail

def ==(other : SourceLocation) : Bool #

Equality check based on file, line, and column.


[View source]
def basename : String #

Returns the base file name (e.g. "main.cr").


[View source]
def column : Int32 #

[View source]
def file : String #

[View source]
def line : Int32 #

[View source]
def normalized_file : String #

Returns the normalized file path using forward slashes.


[View source]
def normalized_path : String #

Alias for normalized_file


[View source]
def source_code : String | Nil #

[View source]
def to_s(io : IO) : Nil #

Formats as file:line or file:line:column.


[View source]