class TypeProf::Core::AST::BranchNode::LoopNode::BreakNode::NextNode::WhenNode::CaseNode::CaseMatchNode::AndNode::OrNode::ReturnNode::RescueNode
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/control.rb, line 504 def initialize(raw_node, lenv) super(raw_node, lenv) @exceptions = raw_node.exceptions.map {|raw_cond| AST.create_node(raw_cond, lenv) } @statements = AST.create_node(raw_node.statements, lenv) if raw_node.statements if raw_node.reference && @statements @reference = AST.create_target_node(raw_node.reference, @statements.lenv) end end
Calls superclass method
TypeProf::Core::AST::Node::new
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/control.rb, line 518 def define0(genv) @exceptions.each {|exc| exc.define(genv) } @reference.define(genv) if @reference @statements.define(genv) if @statements end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/control.rb, line 530 def install0(genv) cond_vtxs = @exceptions.map do |exc| case exc when AST::SplatNode ary_vtx = exc.expr.install(genv) @changes.add_splat_box(genv, ary_vtx).ret else exc.install(genv) end end if @reference @reference.install(genv) cond_vtxs.each do |cond_vtx| instance_ty_box = @changes.add_instance_type_box(genv, cond_vtx) @changes.add_edge(genv, instance_ty_box.ret, @reference.rhs.ret) end end if @statements @statements.install(genv) else Source.new(genv.nil_type) end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/control.rb, line 516 def subnodes = { exceptions:, reference:, statements: } def define0(genv) @exceptions.each {|exc| exc.define(genv) } @reference.define(genv) if @reference @statements.define(genv) if @statements end def undefine0(genv) @exceptions.each {|exc| exc.undefine(genv) } @reference.undefine(genv) if @reference @statements.undefine(genv) if @statements end def install0(genv) cond_vtxs = @exceptions.map do |exc| case exc when AST::SplatNode ary_vtx = exc.expr.install(genv) @changes.add_splat_box(genv, ary_vtx).ret else exc.install(genv) end end if @reference @reference.install(genv) cond_vtxs.each do |cond_vtx| instance_ty_box = @changes.add_instance_type_box(genv, cond_vtx) @changes.add_edge(genv, instance_ty_box.ret, @reference.rhs.ret) end end if @statements @statements.install(genv) else Source.new(genv.nil_type) end end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/control.rb, line 524 def undefine0(genv) @exceptions.each {|exc| exc.undefine(genv) } @reference.undefine(genv) if @reference @statements.undefine(genv) if @statements end