class TypeProf::Core::LocalEnv

Attributes

break_vtx[R]
cref[R]
locals[R]
next_boxes[R]
path[R]
return_boxes[R]

Public Class Methods

new(path, cref, locals, return_boxes) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 280
def initialize(path, cref, locals, return_boxes)
  @path = path
  @cref = cref
  @locals = locals
  @return_boxes = return_boxes
  @break_vtx = nil
  @next_boxes = []
  @filters = {}
end

Public Instance Methods

add_next_box(box) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 312
def add_next_box(box)
  @next_boxes << box
end
add_return_box(box) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 308
def add_return_box(box)
  @return_boxes << box
end
apply_read_filter(genv, node, name, vtx) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 329
def apply_read_filter(genv, node, name, vtx)
  if @filters[name] && !@filters[name].empty?
    case @filters[name].last
    when :non_nil
      return NilFilter.new(genv, node, vtx, false).next_vtx
    end
  end
  vtx
end
exist_var?(name) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 304
def exist_var?(name)
  !!@locals[name]
end
get_break_vtx() click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 316
def get_break_vtx
  @break_vtx ||= Vertex.new(:break_vtx)
end
get_var(name) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 300
def get_var(name)
  @locals[name] || raise("#{ name }")
end
new_var(name, node) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 292
def new_var(name, node)
  @locals[name] = Vertex.new(node)
end
pop_read_filter(name) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 325
def pop_read_filter(name)
  (@filters[name] ||= []).pop
end
push_read_filter(name, type) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 321
def push_read_filter(name, type)
  (@filters[name] ||= []) << type
end
set_var(name, vtx) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/env.rb, line 296
def set_var(name, vtx)
  @locals[name] = vtx
end