class TypeProf::Core::Block
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/env/method.rb, line 86 def initialize(node, f_ary_arg, f_args, next_boxes) @node = node @f_ary_arg = f_ary_arg @f_args = f_args @next_boxes = next_boxes end
: (AST::CallBaseNode, Vertex, Array, Array) -> void
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/env/method.rb, line 95 def accept_args(genv, changes, caller_positionals) if caller_positionals.size == 1 && @f_args.size >= 2 single_arg = caller_positionals[0] @f_args.each_with_index do |f_arg, i| elem_vtx = changes.add_splat_box(genv, single_arg, i).ret changes.add_edge(genv, elem_vtx, f_arg) end else caller_positionals.zip(@f_args) do |a_arg, f_arg| changes.add_edge(genv, a_arg, f_arg) if f_arg end end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/env/method.rb, line 110 def add_ret(genv, changes, ret) @next_boxes.each do |box| changes.add_edge(genv, box.a_ret, ret) end end