Skip to content

Commit

Permalink
Add Ruby 2.7 node types to tree traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
Drenmi authored and bbatsov committed Jan 2, 2020
1 parent af3ed4d commit 7a193e0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/rubocop/ast/traversal.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

# rubocop:disable Metrics/ModuleLength
module RuboCop
module AST
# Provides methods for traversing an AST.
Expand All @@ -18,15 +19,21 @@ def walk(node)
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

Expand Down Expand Up @@ -181,3 +188,4 @@ def on_case(node)
end
end
end
# rubocop:enable Metrics/ModuleLength

0 comments on commit 7a193e0

Please sign in to comment.