class Sexp

Attributes

paren[W]

Public Instance Methods

block_pass?() click to toggle source
# File lib/rp_extensions.rb, line 47
def block_pass?
  any? { |s| Sexp === s && s.sexp_type == :block_pass }
end
check_line_numbers() click to toggle source
# File lib/ruby_parser_extras.rb, line 12
def check_line_numbers
  raise "bad nil line for:\n%s" % [self.pretty_inspect] if nil_line?
  raise "bad line number for:\n%s" % [self.pretty_inspect] unless
    Integer === self.line &&
    self.line >= 1 &&
    self.line <= self.line_min
end
line_min() click to toggle source

Returns the minimum line number of the children of self.

# File lib/ruby_parser_extras.rb, line 23
def line_min
  @line_min ||= [self.deep_each.map(&:line).min, self.line].compact.min
end
nil_line?() click to toggle source
# File lib/ruby_parser_extras.rb, line 27
def nil_line?
  self.deep_each.map(&:line).any?(&:nil?)
end
paren() click to toggle source
# File lib/rp_extensions.rb, line 43
def paren
  @paren ||= false
end