Class: Delorean::Call

Inherits:
SNode
  • Object
show all
Defined in:
lib/delorean/nodes.rb

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



399
400
401
# File 'lib/delorean/nodes.rb', line 399

def check(context, *)
  al.text_value.empty? ? [] : al.check(context)
end

#rewrite(context, vcode) ⇒ Object



403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/delorean/nodes.rb', line 403

def rewrite(context, vcode)
  if 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)
    # FIXME: Do we really need this check here?
    # ruby class call
    class_name = vcode.text
    context.parse_check_call_fn(i.text_value, arg_count, class_name)
  end

  "_instance_call(#{vcode}, '#{i.text_value}', [#{args_str}], _e)"
end