-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ruby) - fix
|=
operator false positives (as block arguments) (#…
…4093) * Fix block parameter handling ruby in ruby block parameter can be enclosed with |. But ruby also has builtin operator |=. This PR ensure that |= is not marked as be the beginning of the block parameter.
- Loading branch information
Showing
4 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>].each <span class="hljs-keyword">do</span> |<span class="hljs-params">num</span>| | ||
puts num | ||
<span class="hljs-keyword">end</span> | ||
|
||
names |= users.map <span class="hljs-keyword">do</span> |<span class="hljs-params">user</span>| | ||
user.name | ||
<span class="hljs-keyword">end</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[1, 2, 3].each do |num| | ||
puts num | ||
end | ||
|
||
names |= users.map do |user| | ||
user.name | ||
end |