Sha256: 5693d9507fbf47089fcb812d4c99842c1e07819ff860f8ae676170f2425a8cf5

Contents?: true

Size: 288 Bytes

Versions: 23

Compression:

Stored size: 288 Bytes

Contents

# encoding: utf-8

module ASTHelper
  def scan_node(node, options = {}, &block)
    yield node if options[:include_origin_node]

    node.children.each do |child|
      next unless child.is_a?(Parser::AST::Node)
      yield child
      scan_node(child, &block)
    end

    nil
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
rubocop-0.25.0 spec/support/ast_helper.rb
ridecharge-rubocop-0.0.1 spec/support/ast_helper.rb
rubocop-0.24.1 spec/support/ast_helper.rb
rubocop-0.24.0 spec/support/ast_helper.rb
rubocop-0.23.0 spec/support/ast_helper.rb
rubocop-0.22.0 spec/support/ast_helper.rb
rubocop-0.21.0 spec/support/ast_helper.rb
rubocop-0.20.1 spec/support/ast_helper.rb
rubocop-0.20.0 spec/support/ast_helper.rb
rubocop-0.19.1 spec/support/ast_helper.rb
rubocop-0.19.0 spec/support/ast_helper.rb
rubocop-0.18.1 spec/support/ast_helper.rb
rubocop-0.18.0 spec/support/ast_helper.rb
rubocop-0.17.0 spec/support/ast_helper.rb
rubocop-0.16.0 spec/support/ast_helper.rb
rubocop-0.15.0 spec/support/ast_helper.rb
rubocop-0.14.1 spec/support/ast_helper.rb
rubocop-0.14.0 spec/support/ast_helper.rb
transpec-0.0.9 spec/support/ast_helper.rb
transpec-0.0.8 spec/support/ast_helper.rb