Skip to content

class Crystal::Block
inherits Crystal::ASTNode

A code block.

'do' [ '|' arg [ ',' arg ]* '|' ]
  body
'end'

| '{' [ '|' arg [ ',' arg ]* '|' ] body '}'

Class methods

.new(args = [] of Var, body = nil, splat_index = nil)

View source

Methods

#==(other : self)

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

#accept_children(visitor)

View source

#after_vars : MetaVars?

View source

#after_vars=(after_vars : MetaVars?)

View source

#args : Array(Var)

View source

#args=(args : Array(Var))

View source

#binder=(binder : YieldBlockBinder?)

View source

#body=(body : ASTNode)

View source

#break

View source

#call : Call?

View source

#call=(call : Call?)

View source

#clone_without_location

View source

#context=(context : Def | NonGenericModuleType | Nil)

View source

#fun_literal : ASTNode?

View source

#fun_literal=(fun_literal : ASTNode?)

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

#scope : Type?

View source

#scope=(scope : Type?)

View source

#splat_index : Int32?

View source

#splat_index=(splat_index : Int32?)

View source

#vars=(vars : MetaVars?)

View source

#visited=(visited)

View source

#visited? : Bool

View source