Sha256: 5d36686b29c22f79f538d494cf18ddd7666df9ea9d5c09ead8c95d2368aadc70

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 Bytes

Contents

module RipperRubyParser
  module SexpHandlers
    module Arguments
      def process_args_add_block exp
        _, regular, block = exp.shift 3
        args = handle_potentially_typeless_sexp(regular)
        args << s(:block_pass, process(block)) if block
        s(:arglist, *args)
      end

      def process_args_add_star exp
        generic_add_star exp
      end

      def process_arg_paren exp
        _, args = exp.shift 2
        args = s() if args.nil?
        args.unshift :arglist unless args.first.is_a? Symbol
        process(args)
      end

      def process_rest_param exp
        _, ident = exp.shift 2
        s(:splat, process(ident))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ripper_ruby_parser-1.1.2 lib/ripper_ruby_parser/sexp_handlers/arguments.rb
ripper_ruby_parser-1.1.1 lib/ripper_ruby_parser/sexp_handlers/arguments.rb
ripper_ruby_parser-1.1.0 lib/ripper_ruby_parser/sexp_handlers/arguments.rb