class Crystal::Location
inherits Reference
¶
A location of an ASTnode
, including its filename, line number and column number.
Included modules
Comparable
Class methods¶
.new(filename : String | VirtualFile | Nil, line_number : Int32, column_number : Int32)
¶
(filename : String | VirtualFile | Nil, line_number : Int32, column_number : Int32)
Methods¶
#dirname : String?
¶
: String?
Returns the directory name of this location's filename. If the filename is a VirtualFile, this is invoked on its expanded location.
#expanded_location
¶
Returns the Location whose filename is a String, not a VirtualFile, traversing virtual file expanded locations.
#inspect(io : IO) : Nil
¶
(io : IO) : Nil
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
#macro_location
¶
Returns the Location whose filename is a String, not a VirtualFile, traversing virtual file expanded locations leading to the original user source code
#to_s(io : IO) : Nil
¶
(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>