Sha256: 109e4d99787b46c257a09422cefeee4aa54d47cce62982d3b75df388daaebf47

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

module RipperRubyParser
  module SexpHandlers
    module MethodCalls
      def process_method_add_arg exp
        _, call, parens = exp.shift 3
        call = process(call)
        call[3] = process(parens) unless parens.empty?
        call
      end

      def process_call exp
        _, receiver, _, ident = exp.shift 4
        with_position_from_node_symbol(ident) {|method|
          s(:call, process(receiver), method, s(:arglist)) }
      end

      def process_command exp
        _, ident, arglist = exp.shift 3
        with_position_from_node_symbol(ident) {|method|
          s(:call, nil, method, process(arglist)) }
      end

      def process_command_call exp
        _, receiver, _, ident, arguments = exp.shift 5
        with_position_from_node_symbol(ident) {|method|
          s(:call, process(receiver), method, process(arguments)) }
      end

      def process_vcall exp
        _, ident = exp.shift 2
        with_position_from_node_symbol(ident) {|method|
          s(:call, nil, method, s(:arglist)) }
      end

      def process_fcall exp
        _, ident = exp.shift 2
        with_position_from_node_symbol(ident) {|method|
          s(:call, nil, method, s(:arglist)) }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ripper_ruby_parser-0.0.2 lib/ripper_ruby_parser/sexp_handlers/method_calls.rb