class TypeProf::Core::AST::StatementsNode::MultiWriteNode::MultiTargetNode::MatchWriteNode::DefinedNode::SplatNode
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/misc.rb, line 244 def initialize(raw_node, lenv) super(raw_node, lenv) @expr = AST.create_node(raw_node.expression, lenv) end
Calls superclass method
TypeProf::Core::AST::Node::new
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/misc.rb, line 255 def install0(genv) vtx = @expr.install(genv) a_args = ActualArguments.new([], [], nil, nil) vtx = @changes.add_method_call_box(genv, vtx, :to_a, a_args, false).ret @changes.add_splat_box(genv, vtx).ret end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/misc.rb, line 253 def mid_code_range = nil def install0(genv) vtx = @expr.install(genv) a_args = ActualArguments.new([], [], nil, nil) vtx = @changes.add_method_call_box(genv, vtx, :to_a, a_args, false).ret @changes.add_splat_box(genv, vtx).ret end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/misc.rb, line 251 def subnodes = { expr: } def mid_code_range = nil def install0(genv) vtx = @expr.install(genv) a_args = ActualArguments.new([], [], nil, nil) vtx = @changes.add_method_call_box(genv, vtx, :to_a, a_args, false).ret @changes.add_splat_box(genv, vtx).ret end end class ForNode < Node def initialize(raw_node, lenv) super(raw_node, lenv) # XXX: tentative implementation # raw_node.index @expr = AST.create_node(raw_node.collection, lenv) @body = raw_node.statements ? AST.create_node(raw_node.statements, lenv) : DummyNilNode.new(TypeProf::CodeRange.new(code_range.last, code_range.last), lenv) end attr_reader :expr, :body def subnodes = { expr:, body: } def install0(genv) @expr.install(genv) @body.install(genv) Source.new(genv.nil_type) end end class FlipFlopNode < Node def initialize(raw_node, lenv) super(raw_node, lenv) @e1 = AST.create_node(raw_node.left, lenv) @e2 = AST.create_node(raw_node.right, lenv) end attr_reader :e1, :e2 def subnodes = { e1:, e2: } def install0(genv) @e1.install(genv) @e2.install(genv) Source.new(genv.true_type, genv.false_type) end end class MatchRequiredNode < Node def initialize(raw_node, lenv) super(raw_node, lenv) @value = AST.create_node(raw_node.value, lenv) @pat = AST.create_pattern_node(raw_node.pattern, lenv) end attr_reader :value, :pat def subnodes = { value:, pat: } def install0(genv) @value.install(genv) @pat.install(genv) Source.new(genv.nil_type) end end class MatchPredicateNode < Node def initialize(raw_node, lenv) super(raw_node, lenv) @value = AST.create_node(raw_node.value, lenv) @pat = AST.create_pattern_node(raw_node.pattern, lenv) end attr_reader :value, :pat def subnodes = { value:, pat: } def install0(genv) @value.install(genv) @pat.install(genv) Source.new(genv.true_type, genv.false_type) end