module Crystal::HookExpansionsContainer

Overview

Holds hook expansions.

For example, a ClassDef node will include macro expansions that result from the inherited hook. So in this code:

class Foo
  macro inherited
    puts 1
  end
end

class Bar < Foo
end

The AST node for the Bar class declaration (a ClassDef) will include a hook expansion consisting of puts 1, that is typed and executed before Bar's body.

Direct including types

Defined in:

compiler/crystal/semantic/hooks.cr

Instance Method Summary

Instance Method Detail

def add_hook_expansion(node) #

[View source]
def hook_expansions : Array(ASTNode) | Nil #

[View source]