class Ikra::TypeInference::ObjectTracer::RootsFinder

Finds all roots (including dependent commands) of a command.

Attributes

roots[R]

Public Class Methods

new() click to toggle source
# File lib/types/inference/object_tracer.rb, line 146
def initialize
    @roots = Set.new
end
process(command) click to toggle source
# File lib/types/inference/object_tracer.rb, line 140
def self.process(command)
    instance = self.new
    command.accept(instance)
    instance.roots
end

Public Instance Methods

visit_array_command(command) click to toggle source
# File lib/types/inference/object_tracer.rb, line 150
def visit_array_command(command)
    @roots.merge(command.lexical_externals.values)
end
visit_array_identity_command(command) click to toggle source
# File lib/types/inference/object_tracer.rb, line 154
def visit_array_identity_command(command)
    super
    @roots.merge(command.target)
end