Module: RipperRubyParser::SexpHandlers::Hashes Private
- Defined in:
- lib/ripper_ruby_parser/sexp_handlers/hashes.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 hash literals
Instance Method Summary collapse
- #process_assoc_splat(exp) ⇒ Object private
-
#process_bare_assoc_hash(exp) ⇒ Object
private
Handle implied hashes, such as at the end of argument lists.
-
#process_hash(exp) ⇒ Object
private
Handle hash literals sexps.
Instance Method Details
#process_assoc_splat(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.
21 22 23 24 |
# File 'lib/ripper_ruby_parser/sexp_handlers/hashes.rb', line 21 def process_assoc_splat(exp) _, param = exp.shift 2 s(:kwsplat, process(param)) end |
#process_bare_assoc_hash(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.
Handle implied hashes, such as at the end of argument lists.
27 28 29 30 |
# File 'lib/ripper_ruby_parser/sexp_handlers/hashes.rb', line 27 def (exp) _, elems = exp.shift 2 s(:hash, *make_hash_items(elems)) end |
#process_hash(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.
Handle hash literals sexps. These can be either empty, or contain a nested :assoclist_from_args Sexp.
12 13 14 15 16 17 |
# File 'lib/ripper_ruby_parser/sexp_handlers/hashes.rb', line 12 def process_hash(exp) _, body = exp.shift 2 return s(:hash) unless body _, elems = body s(:hash, *make_hash_items(elems)) end |