class TypeProf::Core::AST::LocalVariableReadNode::ItLocalVariableReadNode::LocalVariableWriteNode::InstanceVariableReadNode
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 77 def initialize(raw_node, lenv) super(raw_node, lenv) @var = raw_node.name end
Calls superclass method
TypeProf::Core::AST::Node::new
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 84 def attrs = { var: } def install0(genv) case @lenv.cref.scope_level when :class, :instance box = @changes.add_ivar_read_box(genv, lenv.cref.cpath, lenv.cref.scope_level == :class, @var) @lenv.apply_ivar_narrowing(genv, self, @var, box.ret) else Source.new() end end def retrieve_at(pos) yield self if code_range.include?(pos) end def narrowings @narrowings ||= [ Narrowing.new({ @var => Narrowing::NilConstraint.new(false) }), Narrowing.new({ @var => Narrowing::NilConstraint.new(true) }), ] end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 86 def install0(genv) case @lenv.cref.scope_level when :class, :instance box = @changes.add_ivar_read_box(genv, lenv.cref.cpath, lenv.cref.scope_level == :class, @var) @lenv.apply_ivar_narrowing(genv, self, @var, box.ret) else Source.new() end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 100 def narrowings @narrowings ||= [ Narrowing.new({ @var => Narrowing::NilConstraint.new(false) }), Narrowing.new({ @var => Narrowing::NilConstraint.new(true) }), ] end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 96 def retrieve_at(pos) yield self if code_range.include?(pos) end