Skip to content

class Crystal::Macro
inherits Crystal::ASTNode

Included modules

Crystal::Annotatable

Class methods

.new(name, args = [] of Arg, body = Nop.new, block_arg = nil, splat_index = nil, double_splat = nil)

View source

Methods

#==(other : self)

Returns true if this reference is the same as other. Invokes same?.

#accept_children(visitor)

View source

#args : Array(Arg)

View source

#args=(args : Array(Arg))

View source

#block_arg : Arg?

View source

#block_arg=(block_arg : Arg?)

View source

#body=(body : ASTNode)

View source

#clone_without_location

View source

#doc : String?

Returns the doc comment attached to this node. Not every node supports having doc comments, so by default this returns nil.

View source

#doc=(doc : String?)

View source

#double_splat : Arg?

View source

#double_splat=(double_splat : Arg?)

View source

#hash(hasher)

#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)

View source

#match

Yields arg, arg_index, object, object_index corresponding to arguments matching the given objects, taking into account this macro's splat index.

View source

#matches?(call_args, named_args)

View source

#name=(name : String)

View source

#name_location : Location?

View source

#name_location=(name_location : Location?)

View source

#name_size

View source

#overrides?(other : Macro)

View source

#owner : Type

#owner=(owner : Type)

View source

#owner? : Type?

#required_named_arguments

View source

#short_reference

View source

#splat_index : Int32?

View source

#splat_index=(splat_index : Int32?)

View source

#to_json(builder : JSON::Builder)

View source

#visibility=(visibility)

View source