Class: Delorean::FnArgs

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

Instance Method Summary collapse

Instance Method Details

#arg_countObject



609
610
611
612
# File 'lib/delorean/nodes.rb', line 609

def arg_count
  defined?(args_rest.args) && !args_rest.args.text_value.empty? ?
    1 + args_rest.args.arg_count : 1
end

#check(context) ⇒ Object



594
595
596
597
598
599
600
# File 'lib/delorean/nodes.rb', line 594

def check(context, *)
  [
    arg0.check(context),
    (args_rest.args.check(context) if
      defined?(args_rest.args) && !args_rest.args.text_value.empty?)
  ].compact.sum
end

#rewrite(context) ⇒ Object



602
603
604
605
606
607
# File 'lib/delorean/nodes.rb', line 602

def rewrite(context)
  rest = ', ' + args_rest.args.rewrite(context) if
    defined?(args_rest.args) && !args_rest.args.text_value.empty?

  [arg0.rewrite(context), rest].compact.sum
end