Module: RipperRubyParser::SexpHandlers::Arrays Private

Defined in:
lib/ripper_ruby_parser/sexp_handlers/arrays.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Sexp handlers for array literals

Instance Method Summary collapse

Instance Method Details

#process_aref(exp) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
15
16
17
18
# File 'lib/ripper_ruby_parser/sexp_handlers/arrays.rb', line 11

def process_aref(exp)
  _, coll, idx = exp.shift 3

  coll = process(coll)
  idx = process(idx) || s(:arglist)
  idx.shift
  s(:call, coll, :[], *idx)
end

#process_array(exp) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
8
9
# File 'lib/ripper_ruby_parser/sexp_handlers/arrays.rb', line 5

def process_array(exp)
  _, elems = exp.shift 2
  return s(:array) if elems.nil?
  s(:array, *handle_array_elements(elems))
end