Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix #7655] Fix an error when processing a line break regexp
Fixes #7655. This PR fixes the following error when processing a regexp with a line break at the start of capture parenthesis. ```console % cat examle.rb /( pattern )/ =~ string % bundle exec rubocop -d (snip) An error occurred while VariableForce cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/7655/examle.rb. end pattern with unmatched parenthesis: /( / /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `initialize' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `new' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:194:in `regexp_captured_names' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:174:in `process_regexp_named_captures' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:86:in `process_node' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/variable_force.rb:80:in `investigate' ```
- Loading branch information