Skip to content

Commit

Permalink
[Fix #6841] NodePattern: Add <> for matching children in any order.
Browse files Browse the repository at this point in the history
These can be used multiple times in the same sequence as well as
nested.

Limitations: A sequence can only contain a single ellipsis (contained
or not within a <> sequence).

Other implementation changes:
- Captures are now an array (e.g. `capture0` is now `captures[0]`)
- Temporary variables like `temp1` were renamed to `node1`.
- Reading tokens until a delimiter was factorized into `tokens_until`
  • Loading branch information
marcandre authored and bbatsov committed Apr 25, 2019
1 parent 38765b1 commit 971328e
Show file tree
Hide file tree
Showing 3 changed files with 355 additions and 106 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

### New features

* [#6841](https://github.com/rubocop-hq/rubocop/issues/6841): Node patterns can now match children in any order using `<>`. ([@marcandre][])
* [#6928](https://github.com/rubocop-hq/rubocop/pull/6928): Add `--init` option for generate `.rubocop.yml` file in the current directory. ([@koic][])
* Add new `Layout/HeredocArgumentClosingParenthesis` cop. ([@maxh][])
* [#6895](https://github.com/rubocop-hq/rubocop/pull/6895): Add support for XDG config home for user-config. ([@Mange][], [@tejasbubane][])
Expand Down

0 comments on commit 971328e

Please sign in to comment.