Sha256: 6790fe40059dbf8a822bbe798433459cb6ace89816deed060b6b423564bda416

Contents?: true

Size: 729 Bytes

Versions: 5

Compression:

Stored size: 729 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)
        if block
          args << s(:block_pass, process(block))
        end
        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?
        unless args.first.is_a? Symbol
          args.unshift :arglist
        end
        process(args)
      end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ripper_ruby_parser-1.0.0 lib/ripper_ruby_parser/sexp_handlers/arguments.rb
ripper_ruby_parser-0.0.8 lib/ripper_ruby_parser/sexp_handlers/arguments.rb
ripper_ruby_parser-0.0.7 lib/ripper_ruby_parser/sexp_handlers/arguments.rb
ripper_ruby_parser-0.0.6 lib/ripper_ruby_parser/sexp_handlers/arguments.rb
ripper_ruby_parser-0.0.5 lib/ripper_ruby_parser/sexp_handlers/arguments.rb