553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
|
# File 'lib/delorean/nodes.rb', line 553
def rewrite(context, vcode)
if !respond_to?(:al) || al.text_value.empty?
args_str = ''
arg_count = 0
else
args_str = al.rewrite(context)
arg_count = al.arg_count
end
if vcode.is_a?(ClassText)
class_name = vcode.text
context.parse_check_call_fn(i.text_value, arg_count, class_name)
end
b_args.elements.each do |element|
element.force_def(context)
end
formulas.each do |element|
element.force_def(context)
end
block_args_str = if b_args.elements.any?
block_args = b_args.elements.map do |v|
v.rewrite(context)
end
"|#{block_args.join(', ')}|"
else
''
end
expr_arr = expressions.elements.map do |v|
v.rewrite(context)
end + ["result#{POST}"]
expression_str = expr_arr.join('; ')
b_args.elements.each do |element|
element.force_undef(context)
end
formulas.each do |element|
element.force_undef(context)
end
block = "{ #{block_args_str} #{expression_str} }"
"_instance_call(#{vcode}, '#{i.text_value}', [#{args_str}], _e) #{block}"
end
|