lib/rubocop/ast/traversal.rb in rubocop-0.78.0 vs lib/rubocop/ast/traversal.rb in rubocop-0.79.0

- old
+ new

@@ -1,7 +1,8 @@ # frozen_string_literal: true +# rubocop:disable Metrics/ModuleLength module RuboCop module AST # 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` @@ -16,19 +17,25 @@ NO_CHILD_NODES = %i[true false nil int float complex rational str sym regopt self lvar ivar cvar gvar nth_ref back_ref cbase arg restarg blockarg shadowarg - kwrestarg zsuper lambda redo retry].freeze + kwrestarg zsuper lambda redo retry + forward_args forwarded_args + match_var match_nil_pattern].freeze ONE_CHILD_NODE = %i[splat kwsplat block_pass not break next preexe postexe match_current_line defined? - arg_expr].freeze + arg_expr pin match_rest if_guard unless_guard + match_with_trailing_comma].freeze MANY_CHILD_NODES = %i[dstr dsym xstr regexp array hash pair mlhs masgn or_asgn and_asgn undef alias args super yield or and while_post until_post iflipflop eflipflop - match_with_lvasgn begin kwbegin return].freeze + match_with_lvasgn begin kwbegin return + in_match case_match in_pattern match_alt + match_as array_pattern array_pattern_with_tail + hash_pattern const_pattern].freeze SECOND_CHILD_ONLY = %i[lvasgn ivasgn cvasgn gvasgn optarg kwarg kwoptarg].freeze NO_CHILD_NODES.each do |type| module_eval("def on_#{type}(node); end", __FILE__, __LINE__) @@ -179,5 +186,6 @@ alias on_irange on_case alias on_erange on_case end end end +# rubocop:enable Metrics/ModuleLength