Skip to content

class Crystal::ToSVisitor
inherits Crystal::Visitor

Class methods

.new(str = IO::Memory.new, macro_expansion_pragmas = nil, emit_doc = false)

View source

Methods

#accept_with_indent(node : ASTNode)

View source

#accept_with_indent(node : Nop)

View source

#accept_with_indent(node : Expressions)

View source

#append_indent

View source

#decorate_arg(node, str)

View source

#decorate_call(node, str)

View source

#decorate_class_var(node, str)

View source

#decorate_instance_var(node, str)

View source

#decorate_singleton(node, str)

View source

#decorate_var(node, str)

View source

#def_name(str)

View source

#in_parenthesis(need_parens, node)

View source

#in_parenthesis

View source

#indent_string

View source

#inside_macro

View source

#keyword(str)

View source

#letter?(string)

View source

#letter_or_underscore?(string)

View source

#needs_suffix?(node : NumberLiteral)

View source

#newline

View source

#outside_macro

View source

#to_s : String

Returns a string representation of this object.

Descendants must usually not override this method. Instead, they must override to_s(io), which must append to the given IO object.

View source

#to_s(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>
View source

#to_s_binary(node, op)

View source

#visit(node : Case)

View source

#visit(node : Require)

View source

#visit(node : RespondsTo)

View source

#visit(node : NilableCast)

View source

#visit(node : Cast)

View source

#visit(node : IsA)

View source

#visit(node : OffsetOf)

View source

#visit(node : InstanceSizeOf)

View source

#visit(node : SizeOf)

View source

#visit(node : PointerOf)

View source

#visit(node : RangeLiteral)

View source

#visit(node : EnumDef)

View source

#visit(node : TypeDef)

View source

#visit(node : FunDef)

View source

#visit(node : LibDef)

View source

#visit(node : Global)

View source

#visit(node : When)

View source

#visit(node : Select)

View source

#visit(node : Unreachable)

View source

#visit(node : MacroId)

View source

#visit(node : FileNode)

View source

#visit(node : TypeNode)

View source

#visit(node : MetaMacroVar)

View source

#visit(node : MetaVar)

View source

#visit(node : Primitive)

View source

#visit(node : AsmOperand)

View source

#visit(node : Asm)

View source

#visit(node : MagicConstant)

View source

#visit(node : Annotation)

View source

#visit(node : TypeOf)

View source

#visit(node : Alias)

View source

#visit(node : Rescue)

View source

#visit(node : ImplicitObj)

View source

#visit(node : Not)

View source

#visit(node : Or)

View source

#visit(node : Def)

View source

#visit(node : External)

View source

#visit(node : ProcPointer)

View source

#visit(node : ProcLiteral)

View source

#visit(node : Var)

View source

#visit(node : Out)

View source

#visit(node : Until)

View source

#visit(node : While)

View source

#visit(node : MultiAssign)

View source

#visit(node : OpAssign)

View source

#visit(node : Assign)

View source

#visit(node : NamedArgument)

View source

#visit(node : Call)

View source

#visit(node : AnnotationDef)

View source

#visit(node : ModuleDef)

View source

#visit(node : ClassDef)

View source

#visit(node : Unless)

View source

#visit(node : If)

View source

#visit(node : Expressions)

View source

#visit(node : NilLiteral)

View source

#visit(node : HashLiteral)

View source

#visit(node : ArrayLiteral)

View source

#visit(node : StringLiteral)

View source

#visit(node : SymbolLiteral)

View source

#visit(node : CharLiteral)

View source

#visit(node : NumberLiteral)

View source

#visit(node : BoolLiteral)

View source

#visit(node : Nop)

View source

#visit(node : Macro)

View source

#visit(node : MacroExpression)

View source

#visit(node : Union)

View source

#visit(node : Metaclass)

View source

#visit(node : InstanceVar)

View source

#visit(node : ReadInstanceVar)

View source

#visit(node : ClassVar)

View source

#visit(node : Yield)

View source

#visit(node : Return)

View source

#visit(node : Break)

View source

#visit(node : Next)

View source

#visit(node : RegexLiteral)

View source

#visit(node : TupleLiteral)

View source

#visit(node : TypeDeclaration)

View source

#visit(node : Block)

View source

#visit(node : Include)

View source

#visit(node : Extend)

View source

#visit(node : And)

View source

#visit(node : DoubleSplat)

View source

#visit(node : Splat)

View source

#visit(node : Underscore)

View source

#visit(node : MacroIf)

View source

#visit(node : Generic)

View source

#visit(node : Path)

View source

#visit(node : MacroFor)

View source

#visit(node : MacroVar)

View source

#visit(node : MacroLiteral)

View source

#visit(node : MacroVerbatim)

View source

#visit(node : ExternalVar)

View source

#visit(node : Arg)

View source

#visit(node : ProcNotation)

View source

#visit(node : Self)

View source

#visit_any(node)

View source

#visit_backtick(exp)

View source

#visit_call(node, ignore_obj = false)

View source

#visit_cast(node, keyword)

View source

#visit_control(node, keyword)

View source

#visit_if_or_unless(prefix, node)

View source

#visit_interpolation

View source

#visit_named_arg_name(name)

View source

#visit_symbol_literal_value(value : String)

View source

#visit_while_or_until(node, name)

View source

#with_indent

View source