Skip to content

Commit

Permalink
Merge pull request #7665 from hanachin/fix_7647
Browse files Browse the repository at this point in the history
[Fix #7647] Handle numblock
  • Loading branch information
koic committed Jan 28, 2020
2 parents d0ccb1e + d8c59ba commit 7b3639b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
* [#7639](https://github.com/rubocop-hq/rubocop/pull/7639): Fix logical operator edge case in `omit_parentheses` style of `Style/MethodCallWithArgsParentheses`. ([@gsamokovarov][])
* [#7661](https://github.com/rubocop-hq/rubocop/pull/7661): Fix to return correct info from multi-line regexp. ([@Tietew][])
* [#7655](https://github.com/rubocop-hq/rubocop/issues/7655): Fix an error when processing a regexp with a line break at the start of capture parenthesis. ([@koic][])
* [#7647](https://github.com/rubocop-hq/rubocop/issues/7647): Fix an `undefined method on_numblock` error when using Ruby 2.7's numbered parameters. ([@hanachin][])

### Changes

Expand Down Expand Up @@ -4335,3 +4336,4 @@
[@pawptart]: https://github.com/pawptart
[@gfyoung]: https://github.com/gfyoung
[@Tietew]: https://github.com/Tietew
[@hanachin]: https://github.com/hanachin
9 changes: 9 additions & 0 deletions lib/rubocop/ast/traversal.rb
Expand Up @@ -185,6 +185,15 @@ def on_case(node)
alias on_when on_case
alias on_irange on_case
alias on_erange on_case

def on_numblock(node)
children = node.children
child = children[0]
send(:"on_#{child.type}", child)
return unless (child = children[2])

send(:"on_#{child.type}", child)
end
end
end
end
Expand Down

0 comments on commit 7b3639b

Please sign in to comment.