class Sexp
Attributes
Public Instance Methods
Source
# File lib/rp_extensions.rb, line 47 def block_pass? any? { |s| Sexp === s && s.sexp_type == :block_pass } end
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
Source
# File lib/ruby_parser_extras.rb, line 23 def line_min @line_min ||= [self.deep_each.map(&:line).min, self.line].compact.min end
Returns the minimum line number of the children of self.
Source
# File lib/ruby_parser_extras.rb, line 27 def nil_line? self.deep_each.map(&:line).any?(&:nil?) end