class Savi::Compiler::Refer::Visitor

Defined in:

savi/compiler/refer.cr

Constructors

Instance Method Summary

Instance methods inherited from class Savi::AST::Visitor

visit(ctx : Compiler::Context, node : Node) visit, visit_any?(ctx : Compiler::Context, node : Node) visit_any?, visit_children?(ctx : Compiler::Context, node : Node) visit_children?, visit_pre(ctx : Compiler::Context, node : Node) visit_pre

Constructor Detail

def self.new(analysis : Analysis, refer_type : ReferType::Analysis, classify : Classify::Analysis | Nil = nil, parent_locals : Hash(String, Savi::Compiler::Refer::Local) = {} of String => Local, locals_sequence_number : Int32 = 0) #

[View source]

Instance Method Detail


[View source]
def create_local(node : AST::Identifier, param_idx : Int32 | Nil = nil) #

[View source]
def create_param_local(node) #

[View source]
def create_yield_param_local(node) #

[View source]
def locals #

[View source]
def sub_branch(ctx, group : AST::Node | Nil, init_locals = locals, &) #

[View source]
def touch(ctx, node : AST::Identifier) #

For an Identifier, resolve it to any known local or type if possible.


[View source]
def touch(ctx, node : AST::FieldRead | AST::FieldWrite | AST::FieldDisplace) #

For a FieldRead, FieldWrite, or FieldDisplace; take note of it by name.


[View source]
def touch(ctx, node : AST::Call) #

[View source]
def touch(ctx, node : AST::Relate) #

[View source]
def touch(ctx, node : AST::Try) #

[View source]
def touch(ctx, node : AST::Node) #

[View source]
def touch_yield_loop(ctx, params : AST::Group | Nil, block : AST::Group | Nil) #

[View source]
def visit(ctx, node) #

This visitor never replaces nodes, it just touches them and returns them.


[View source]
def visit_children?(ctx, node : AST::Call) #

For a call node, defer the normal visit order, so that we can visit the receiver, identifier, and args in the normal order, but visit the yield params and yield block in a special sub-visitor.


[View source]