class TypeProf::Core::AST::LocalVariableReadNode
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 4 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 11 def attrs = { var: } def install0(genv) @lenv.get_var(@var) 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 13 def install0(genv) @lenv.get_var(@var) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/variable.rb, line 21 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 17 def retrieve_at(pos) yield self if code_range.include?(pos) end