Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Trim trailing spaces #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/syntax_tree/implicits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize

# Adds the implicitly rescued StandardError into a bare rescue clause. For
# example,
#
#
# begin
# rescue
# end
Expand All @@ -29,7 +29,7 @@ def bare_rescue(location)
# Adds the implicitly referenced value (local variable or method call) that
# is added into a hash when the value of a key-value pair is omitted. For
# example,
#
#
# { value: }
#
# becomes
Expand Down Expand Up @@ -57,14 +57,14 @@ def precedence_parentheses(location)
def self.find(program)
implicits = new
queue = [[nil, program]]

until queue.empty?
parent_node, child_node = queue.shift

child_node.child_nodes.each do |grand_child_node|
queue << [child_node, grand_child_node] if grand_child_node
end

case [parent_node, child_node]
in _, Rescue[exception: nil, location:]
implicits.bare_rescue(location)
Expand Down
4 changes: 2 additions & 2 deletions test/node_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_assoc
guard_version("3.1.0") do
def test_assoc_no_value
source = "{ key1:, key2: }"

at = location(chars: 2..7)
assert_node(Assoc, "assoc", source, at: at) { |node| node.assocs.first }
end
Expand Down Expand Up @@ -238,7 +238,7 @@ def test_blockarg
guard_version("3.1.0") do
def test_blockarg_anonymous
source = "def method(&); end"

at = location(chars: 11..12)
assert_node(BlockArg, "blockarg", source, at: at) do |node|
node.params.contents.block
Expand Down