Module: RipperRubyParser::SexpHandlers::Loops Private

Defined in:
lib/ripper_ruby_parser/sexp_handlers/loops.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 loops

Instance Method Summary collapse

Instance Method Details

#process_for(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
25
26
27
28
29
30
31
# File 'lib/ripper_ruby_parser/sexp_handlers/loops.rb', line 21

def process_for(exp)
  _, var, coll, block = exp.shift 4
  coll = process(coll)
  assgn = s(:lasgn, process(var)[1])
  block = unwrap_nil process(block)
  if block
    s(:for, coll, assgn, block)
  else
    s(:for, coll, assgn)
  end
end

#process_until(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
# File 'lib/ripper_ruby_parser/sexp_handlers/loops.rb', line 5

def process_until(exp)
  handle_conditional_loop :until, :while, exp
end

#process_until_mod(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.



9
10
11
# File 'lib/ripper_ruby_parser/sexp_handlers/loops.rb', line 9

def process_until_mod(exp)
  handle_conditional_loop_mod :until, :while, exp
end

#process_while(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.



13
14
15
# File 'lib/ripper_ruby_parser/sexp_handlers/loops.rb', line 13

def process_while(exp)
  handle_conditional_loop :while, :until, exp
end

#process_while_mod(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.



17
18
19
# File 'lib/ripper_ruby_parser/sexp_handlers/loops.rb', line 17

def process_while_mod(exp)
  handle_conditional_loop_mod :while, :until, exp
end