Module: RuboCop::AST::Traversal
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Exceptions:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
CallbackCompiler
|
|
Defined in: | lib/rubocop/ast/traversal.rb |
Overview
Provides methods for traversing an AST.
Does not transform an AST; for that, use Parser::AST::Processor.
Override methods to perform custom processing. Remember to call super
if you want to recursively process descendant nodes.
Constant Summary
-
MISSING =
# File 'lib/rubocop/ast/traversal.rb', line 189to_define
-
NO_CHILD_NODES =
private
# File 'lib/rubocop/ast/traversal.rb', line 109(no_children + opt_symbol_child + literal_child).to_set.freeze
-
TYPE_TO_METHOD =
# File 'lib/rubocop/ast/traversal.rb', line 15Hash.new { |h, type| h[type] = :"on_#{type}" }
Class Method Summary
CallbackCompiler
- Extended
Instance Method Summary
Instance Method Details
#walk(node)
[ GitHub ]# File 'lib/rubocop/ast/traversal.rb', line 17
def walk(node) return if node.nil? send(TYPE_TO_METHOD[node.type], node) nil end