class Myst::Location

Defined in:

myst/syntax/location.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file : String = "", line : Int32 = 0, col : Int32 = 0, length : Int32 = 0) #

[View source]

Instance Method Detail

def col : Int32 #

[View source]
def col=(col : Int32) #

[View source]
def dirname : String | Nil #

[View source]
def file : String #

[View source]
def file=(file : String) #

[View source]
def inspect(io : IO) #
Description copied from class Reference

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>

[View source]
def inspect #
Description copied from class Object

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.


[View source]
def length : Int32 #

[View source]
def length=(length : Int32) #

[View source]
def line : Int32 #

[View source]
def line=(line : Int32) #

[View source]
def to_s(io : IO) #
Description copied from class Reference

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>

[View source]
def to_s(colorize = false) #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]