class Crystal::Formatter
inherits Crystal::Visitor
¶
Class methods¶
Methods¶
#align_infos(lines, align_infos)
¶
(lines, align_infos)
Align series of successive inline when/else (in a case), or hash literals (the left side of the =>)
#at_skip?
¶
The parser transforms def foo(@x); end
to def foo(x); @x = x; end
so if we
find an instance var we later need to skip the first expressions in the body
#finish_list(suffix, has_newlines, found_comment, found_first_newline, write_space_at_end)
¶
(suffix, has_newlines, found_comment, found_first_newline, write_space_at_end)
#format_args(args : Array, has_parentheses, named_args = nil, block_arg = nil, needed_indent = @indent + 2, do_consume_newlines = false)
¶
(args : Array, has_parentheses, named_args = nil, block_arg = nil, needed_indent = @indent + 2, do_consume_newlines = false)
#skip_space_or_newline(last : Bool = false, at_least_one : Bool = false, next_comes_end : Bool = false)
¶
(last : Bool = false, at_least_one : Bool = false, next_comes_end : Bool = false)
#skip_space_or_newline(indent : Int32, last : Bool = false, at_least_one : Bool = false, next_comes_end : Bool = false)
¶
(indent : Int32, last : Bool = false, at_least_one : Bool = false, next_comes_end : Bool = false)
#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>
#visit_string_interpolation(node, token, line, column, old_indent, old_string_continuation, wrote_token = false)
¶
(node, token, line, column, old_indent, old_string_continuation, wrote_token = false)